You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When Svelte sees an element with an orphaned } character it interprets the bracket as an attribute. e.g.
<h1 }>text</h1>
causes this to be generated in the create function: attr(h1, "}", "");
and causes the runtime error Failed to execute 'setAttribute' on 'Element': '}' is not a valid attribute name.
Expected behavior
IMO the compiler should throw an error instead of generating code for this.
Severity
Not too important. Was pretty obvious what happened when I looked back at my source file and saw the } character I missed deleting.
The text was updated successfully, but these errors were encountered:
dimfeld
changed the title
Stray } in element is interpreted as an attribute and causes a runti,e error
Stray } in element is interpreted as an attribute and causes a runtime error
Apr 7, 2020
dimfeld
added a commit
to dimfeld/svelte
that referenced
this issue
Apr 8, 2020
Describe the bug
When Svelte sees an element with an orphaned
}
character it interprets the bracket as an attribute. e.g.<h1 }>text</h1>
causes this to be generated in the create function:
attr(h1, "}", "");
and causes the runtime error
Failed to execute 'setAttribute' on 'Element': '}' is not a valid attribute name.
REPL: https://svelte.dev/repl/14ee9617902447809daec74565b61a8e?version=3.20.1
Expected behavior
IMO the compiler should throw an error instead of generating code for this.
Severity
Not too important. Was pretty obvious what happened when I looked back at my source file and saw the
}
character I missed deleting.The text was updated successfully, but these errors were encountered: