rrdelaney / jadelint

:dragon: A linter for the Jade templating language
https://rrdelaney.github.io/jadelint
MIT License
6 stars 1 forks source link

Syntax Error from attribute="#{{expression}}" #17

Open PyroSA opened 9 years ago

PyroSA commented 9 years ago

Syntax Error reported by linter on an attribute containing "#{{expression}}".

We have an angular directive mp-file with an attribute file-description:

In this case we have an entry that (trimmed down), looks like this in Jade: mp-file(file-description="Certificate #{{ certificate.number }}")

This correctly compiles to html: <mp-file file-description="Certificate #{{ certificate.number }}"></mp-file>

But this still throws a 'Syntax Error' through the linter.

It seem to match the #{

Angular matches on {{ expression }}, so in this case we might have certificate.number = 123 with the intention is to set the file-description to Certificate #123

PyroSA commented 9 years ago

It might be worth mentioning - Most of our client-side jade that use these are compiled to static HTML. The Jade that does use #{variable} to build dynamic HTML/XML does not use Angular, so there's no overlap where #{} and #{{}} get confused.

rrdelaney commented 8 years ago

Alright, this is a bit weird and I'm going to start looking into it.

Sorry for the delay, hackathon season has eaten up most of my time.