-
-
Notifications
You must be signed in to change notification settings - Fork 969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In-browser compilation with spaces after opening { bracket #2988
Comments
The native browser template inner html is something we can't control with our compiler. However the Riot attribute expressions support also single and double quotes to circumvent this issue. |
To clarify what @GianlucaGuarini said above about innerHTML on template tag within a browser. If you run
you can easily see that the missing quotes around the onclick value mess up the dom parsing in the browser => |
What about this text to the In-Browser Compilation section Important Note: When writing expressions within attributes (like For example:
Instead, use either of the following formats:
This is due to how the browser parses the innerHTML of the tag, which can affect the way Riot.js handles the compilation. Always ensure consistent HTML formatting to avoid these issues. For more details, see the related GitHub issue #2988 |
I found an issue during in-browser compilation where a space after the opening bracket of
onclick={
breaks the compiler.This doesn't compile:
In the browser console, if I do this:
code
contains this:This compiles:
And this compiles:
The text was updated successfully, but these errors were encountered: