PrismJS / prism

Lightweight, robust, elegant syntax highlighting.
https://prismjs.com
MIT License
12.3k stars 1.3k forks source link

CSS Highlighting Error within a custom element #426

Open ericrange opened 9 years ago

ericrange commented 9 years ago
.some-class {
   width:  {{shareSize}}px;
   height: {{shareSize}}px;
}

{{shareSize}} is an attribute for my custom element (polymer) which is used as follow: <my-custom-element shareSize=32></my-custom-element>

so... yes... the hightlighting breaks at the first {{shareSize}}px;

Golmote commented 9 years ago

I don't know Polymer at all, but this does not look like valid CSS.

ericrange commented 9 years ago

polymer replace the "{{shareSize}}" with a number. so at the end it is valid css. you dont know polymer?? you dont know the future of the web?? :P https://www.polymer-project.org/

Golmote commented 9 years ago

Well, I heard about it, but never gave it a look.

As I understand it, your problem relates to the syntax Polymer uses to provide data-binding in templates. Thus it's normal that the CSS highlighter fails on it ^^

Polymer would probably need a small component on its own.