Polymer - special chars around data bindings

Viewed 88

When I'm trying to use some "special" characters around the Polymer data bindings it does work, but the linter doesn't recognise the syntax. For example, if I use the starter kit to render the sample polymer-2-element, and after that instead of the default:

<h2>Hello [[prop1]]!</h2>

I add

<h2>Hello [[[prop1]]]!</h2>
<h2>Hello &#91;[[prop1]]&#93;!</h2>

it does work and shows something like this: https://i.imgur.com/7nkJGda.png

But my problem is that I have polymer lint in my build script and it fails because it returns these errors: https://i.imgur.com/027qxWf.png

LE: forgot to mention: if I add a space in between the first opening bracket and the data binding it does work.

I realise this is not a very serious problem, but I would like to know if anyone else found a solution to it, because I have had some other problems with HTML entities in Polymer that I had to work around and I'm curious if there's some fix I'm not aware of.

UPDATE: also forgot to mention that I am perfectly aware that I can wrap the property in a method call and have it return the padded value, but I was hoping for something simpler to write and easier to understand for anyone reading that code after a while.

0 Answers
Related