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

. in tag attribute causes the tag not to be recognized #95

Closed
ckaznocha opened this issue Nov 3, 2015 · 8 comments
Closed

. in tag attribute causes the tag not to be recognized #95

ckaznocha opened this issue Nov 3, 2015 · 8 comments

Comments

@ckaznocha
Copy link

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>HTMLHint</title>
</head>
<body>
    <div foo.bar="baz" >HTMLHint: help your html code better</div>
</body>
</html>

gives:

      L8 |    <div foo.bar="baz" >HTMLHint: help your html code better</div>
              ^ Special characters must be escaped : [ < ]. (spec-char-escape)
      L8 |    <div foo.bar="baz" >HTMLHint: help your html code better</div>
                                 ^ Special characters must be escaped : [ > ]. (spec-char-escape)
      L8 |...z" >HTMLHint: help your html code better</div>
                                                     ^ Tag must be paired, no start tag: [ </div> ] (tag-pair)
@ckaznocha ckaznocha changed the title . in tag attribute causes a the tag not to be recognized . in tag attribute causes the tag not to be recognized Nov 3, 2015
@yaniswang
Copy link
Contributor

I don't know the . is good or not in w3c?
Who know?

@waldyrious
Copy link
Contributor

According to http://www.w3.org/TR/html5/syntax.html#syntax-attributes:

Attribute names must consist of one or more characters other than the space characters, U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), ">" (U+003E), "/" (U+002F), and "=" (U+003D) characters, the control characters, and any characters that are not defined by Unicode.

So it looks like . is allowed.

@ckaznocha
Copy link
Author

Came to post the same link as @waldyrious. Just for some color, I using a . in an attribute name because an SPA framework's functionality requires it.

@ccqgithub
Copy link

@yaniswang I am painful to use vue.js along with htmlhint, but i do not know who is right ……

//template in vue.js 
<button @click.stop.prevent="doThis"></button>

htmlhint report the 'tag-paired' error, how can i extend a tag-paired-vue to replace the tag-paired rule ?
I wish to see more rules what is applicable in the project …… ^_^

@yaniswang
Copy link
Contributor

@ccqgithub HTMLHint is not suuport for template code.

@thisconnect
Copy link

I would love if HTMLHint would use a html parser.. like https://www.npmjs.com/package/parse5
It also supports streaming.

@thisconnect
Copy link

parse5 gives you div [ { name: 'foo.bar', value: 'baz' } ] for <div foo.bar="baz" >

@saeidzebardast
Copy link

Same problem in Polymer when using $ in attribute name:

  • ([</div>] Tag must pair)
<div id$="[[myId]]">
  <content></content>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants