Skip to content
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

Update htmlparser/lexer to support html5 attribute syntax #1380

Merged
merged 3 commits into from Jul 26, 2019

Conversation

@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Jul 14, 2019

With HTML5 almost any character is allowed in an attribute name and angular is actively using this. With angular attribute names like this are common:

  • <input [value]='test' /> (property binding)
  • <input (change)='test' /> (event binding)
  • <input [(value)]='test' /> (twoway binding)
  • <input #ref /> (template reference)
  • <input *ngIf='test' /> (structural directive)

This changeset updates the html.parser and html.lexer modules to support the syntax.

It is not the intention of this changeset to change the html validator. The validator for example will still (rightly) complain, that the angular attribute names are not serializeable as XML.

@matthiasblaesing

This comment has been minimized.

Copy link
Contributor Author

matthiasblaesing commented Jul 16, 2019

The upload of the new htmlparser binary succeeded and travis is happy.

@Chris2011 could you please have a look at the changeset. I get the feeling, that you might be interested in it anyway.

@Chris2011

This comment has been minimized.

Copy link
Contributor

Chris2011 commented Jul 16, 2019

Had a look and it seems good to me. Thx for implementing it :). I saw your comment about the validator, so the HTML file will still underline all attributes that are not "correct"?

@matthiasblaesing

This comment has been minimized.

Copy link
Contributor Author

matthiasblaesing commented Jul 16, 2019

Yes, if you don't like these hints, open the options dialog, the editor category, hints tab and uncheck "HTML Validator -> Attributes".

@matthiasblaesing matthiasblaesing merged commit 9188663 into apache:master Jul 26, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@matthiasblaesing matthiasblaesing deleted the matthiasblaesing:update_htmlparser2 branch Jul 27, 2019
@junichi11 junichi11 added this to the 11.2 milestone Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.