-
-
Notifications
You must be signed in to change notification settings - Fork 966
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
riot.compile() troubles parsing HTML files #1116
Comments
Riot is indentation sensitive, it seems your html string is not correctly indented, this is the correct one http://jsfiddle.net/jc2ywhfv/2/ |
do you mean indented exactly by just two spaces? It seems a rather restrictive requirement. At least I suggest to state it clearly in the docs, not everybody use this indentation rule on HTML. |
I mean that this: <my-tag> <!-- tralling spaces -->
<div>
<child-tag data={data}></child-tag> <!-- tralling spaces -->
</div> <!-- tralling spaces -->
</my-tag> is not a valid riot markup, maybe @aMarCruz could fix this issue in the new upcoming compiler with riot 2.3.0 |
Will be fixed in 2.3.0 |
Ok, this was (partially) fixed in 2.3.0, but we have two different behaviors and one bug, depending on where the tag is defined. Trailing comments and spaces inside custom tags are removed in both external .tag files and inlined tags. Indentation is the problem. Beta versions of the compiler 2.3 worked with any indentation, but in the last phase this changed to support treeview-like constructions, such as in this file and now, again, zero indentation is a requirement. Even more, in some parts of Indentation inside the opening and closing html tags (internal) is irrelevant, except for the closing tag ( Right now I'm reviewing the code of these routines. I will send a fix for |
this issue was fixed http://jsfiddle.net/x9sakras/ |
Working with the compiler, I noticed that it often fails to parse HTML correctly.
See for example this JsFiddle:
compiles into:
Is this an expected beaviour? The docs say tags have to be indented (and they are) and tag definition must start at beginning of line (and it does). Also there are no tabs, just spaces and newlines.
The text was updated successfully, but these errors were encountered: