You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Highlighting doesn't work when it is inside a dom-repeat template. Reason being the _highlight method inside prism-highlighter.html never gets called. It will be nicer if we expose the prism API directly as a method on the component. It works if I explicitly use the _highlight method.
FixesPolymerElements#24 by exposing the highlighter functionality to data-binding and
programatic use.
Also now checks that the host exists before dealing with event listeners.
The internal _highlight method is never called because the prism-highlighter's parent's attach function is called before the prism-highlighter's attach function.
You'll notice that the prism-highlighter's attach function registers _highlight as a handler for the 'syntax-highlight' event, but that event fires in the parent's attach function before the handler is registered.
Potential workaround would be to fire the syntax-highlight event asynchronously, after the highlighter has been attached.
Description
Highlighting doesn't work when it is inside a dom-repeat template. Reason being the _highlight method inside prism-highlighter.html never gets called. It will be nicer if we expose the prism API directly as a method on the component. It works if I explicitly use the _highlight method.
Expected outcome
Code highlights
Actual outcome
The tag not getting rendered
Live Demo
https://jsbin.com/vipuxo/2/edit?html,output
Steps to reproduce
Have a prism-element inside a dom-repeat template
Browsers Affected
The text was updated successfully, but these errors were encountered: