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
fix #225 Improve compiler error for attributes with missing quotes #307
Conversation
@@ -191,22 +191,58 @@ HTMLName | |||
{return first + next.join("");} | |||
|
|||
HTMLAttName | |||
= first:[a-zA-Z#] next:([a-zA-Z] / [0-9] / "-")* endString:(":" end:([a-zA-Z] / [0-9] / "-")+ {return ":" + end.join("")})? | |||
= first:[a-zA-Z#] next:([a-zA-Z] / [0-9] / "-" / "_")* endString:(":" end:([a-zA-Z] / [0-9] / "-" / "_")+ {return ":" + end.join("")})? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need _
in attributes name ? Sounds weird to me as it is not standard... -
would be recommanded wherever you are tempted to use an _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it... 😃 !!
This is fine for me ! |
this._logError(msg, error); | ||
} | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, I haven't read the whole commit, but first thing I noticed is that _elementOrComponent
becomes a 160-liner after this change. Maybe it would make sense to split some parts of it using helper functions? (either now or in a separate refactor commit).
This PR adds error messages for wrong attributes of HTML elements and components.
Please have a look at the tests first.
It doesn't takes care of allowing single quotes, @olaf-k is working on this part.