"Unexpected closing tag" error
See original GitHub issueWhen formatting the following code
<div class="account" >
<div class="accounttitle" >
<p >Account</p>
<DynamicTooltip content={$t(message) || ''} >
<Icon icon={{ name: 'info_outline' }} />
</DynamicTooltip >
</div >
</div >
<script>
/* JavaScript goes here... */
</script>
I get an error:
9 |
SyntaxError: Unexpected closing tag "DynamicTooltip". It may happen when the tag has already
been closed by another tag. For more info see
https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (6:7)
4 | <DynamicTooltip content={$t(message) || ''} >
5 | <Icon icon={{ name: 'info_outline' }} />
> 6 | </DynamicTooltip >
| ^
7 | </div >
8 | </div >
If don’t use ||
in the 4th line of the original code, the error doesn’t appear.
I’m using the latest version of Prettier from GitHub, and version 1.1.0 of prettier-plugin-svelte
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Unexpected closing tag "div" error angular2 HTML
This error occurred when you open an element and don't close its. this error shows up in this example ...
Read more >Angular Error: Template parse errors: Unexpected closing tag ...
Angular Error: Template parse errors: Unexpected closing tag “a”. It may happen when the tag has already been closed by another tag.
Read more >Hugo, Prettier, and "SyntaxError: Unexpected closing tag"
Like many, I have opened the body tag in a header. html file and am closing it in the footer. html file.
Read more >Unexpected closing tag« when go-template blog is inside of ...
SyntaxError: Unexpected closing tag "BPGT25EPGT". It may happen when the tag has already been closed by another tag.
Read more >TIP : Blazor Unexpected closing tag 'div' with no matching start ...
We get this error “ RZ9981 Unexpected closing tag 'div' with no matching start tag.” The little trick is to use either.
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 Free
Top 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
@mikenikles I never thought much about it, but sure, it does not make sense to nest them but that it is actually by spec forbidden, I had no idea.
Thanks for highlighting that
No longer reproducible with the latest version of Svelte, Prettier and prettier-plugin-svelte.