pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Invalid attribute separator found #19

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

Great project!

I have the following .jade-lintrc file and am getting some unexpected errors:

{
  "validateAttributeSeparator": " "
}
➜  idea-town git:(master) ✗ jade-lint --version
1.2.2

➜  idea-town git:(master) ✗ jade-lint views
views/includes/footer.jade:5
    3|     a(href="https://www.mozilla.org/").moz-logo
    4|     for plate in boilerplate
  > 5|       a(target="_blank" href=plate.url).boilerplate= plate.name
    6|

Invalid attribute separator found

views/includes/tabzilla.jade:3
    1| .wrapper-null
    2|   #tabzilla
  > 3|     a(href="https://mozilla.org") Mozilla
    4|

Invalid attribute separator found

What seems weird is that in the first result, my validateAttributeSelector is set to a single space, which I'm using in the <a> tag attributes.

In the second example, I only have one attribute. Not sure if it's somehow confusing the space before the "Mozilla" string.

benedfit commented 9 years ago

Thanks for highlighting the issue, I know exactly why this is happening, and I'll get a fix in place after the weekend

pdehaan commented 9 years ago

Awesome, thanks!

benedfit commented 9 years ago

This is fixed in v1.2.5

benedfit commented 9 years ago

Actually hold fire on getting the update if either of the following examples appear in your Jade as they will not validate correctly:

//- Multiple attribute blocks
div(class='class')(title='title')

//- Attribute values that contain brackets
img(src=url('foo')))
benedfit commented 9 years ago

Fixed in v1.2.6