Indentation seems to break compiler
See original GitHub issueIt seems that indenting HTML code when writing .svx components breaks the compiler and makes it think that elements weren’t closed.
Seems to happen when there are multiple levels of indentation with space and returns like:
<main>
<h1>Major Headline</h1>
<section>
<p>Here is text</p>
<h2>A Second Heading</h2>
<SvelteComponentToRender />
```html
<h1>Example</h1>
<p>code block</p>
```
</section>
</main>
The error:
[!] (plugin svelte) ParseError: <section> was left open
src/App.svx
12: <main>
13: <h1>Major Headline</h1>
14: <section>
^
15: <p class="info">
16: All found on
ParseError: <section> was left open
at error (project_folder/node_modules/svelte/src/compiler/utils/error.ts:25:16)
at Parser$1.error (project_folder/node_modules/svelte/src/compiler/parse/index.ts:93:3)
at new Parser$1 (project_folder/node_modules/svelte/src/compiler/parse/index.ts:54:9)
at parse (project_folder/node_modules/svelte/src/compiler/parse/index.ts:208:17)
at compile (project_folder/node_modules/svelte/src/compiler/compile/index.ts:79:14)
at project_folder/node_modules/rollup-plugin-svelte/index.js:252:22
at ModuleLoader.addModuleSource (project_folder/node_modules/rollup/dist/shared/rollup.js:17430:30)
at ModuleLoader.fetchModule (project_folder/node_modules/rollup/dist/shared/rollup.js:17491:9)
at project_folder/node_modules/rollup/dist/shared/rollup.js:17461:36
at async Promise.all (index 0)
I wasn’t sure if this was a Markdown thing i wasn’t aware of or if it is MDsvX related.
If this is clear as mud I will try to get a better example for ya!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Indentation Error in Python | How to Solve it - Edureka
This article will provide you with a detailed understanding of Indentation error in Python and the solutions to avoid the same.
Read more >Indenting C Programs
Losing points on assignments because your instructor says you aren't aligning your program statements correctly? You've come to the right web page. The...
Read more >Preprocessor directives indentation in Visual C++ 2010
And to not break preprocessor directives indentation with auto-indent (CTRL+K, CTRL+F)? Or even better, to handle preprocessor directives like everything else?
Read more >Shift+Tab indentation breaks my alignment
Shift+Tab indentation breaks my alignment.. GSGreg Slazinski ... In Visual Studio there is an compile error appears when SHIFT-Tab pressed after TAB:.
Read more >Line Break / Indentation Error in Windows · Issue #29 - GitHub
When I run Eco.compile(File.read ("ANY FILE WITH A CONTROL STRUCTURE") ) I get an unexpected indent error, when I run this same command...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will expand on this in the limitations section of the docs, I don’t think I consider this a bug: indentation will cause issues with markdown as per the standard.