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
Prism version: 1.17.1 (probably since markup templating was introduced a year ago)
Environment: Browser, Node
Does the latest version of Prism from the download page also have this issue?
Yes
Description
Markup templating injects placeholders: stuff like ___PHP0___.
If this is injected inside CSS, CSS Extras picks up on the number and creates a number token for it.
Because the placeholder is no longer a single text token, the placeholder can no longer be tokenised and remains in the resulting text instead of being replaced.
It was changed in #1450 8 months ago. But it may have been around for at least 6 years (checking blames up to get to the initial commit). It’s more likely that this was introduced through markup templating in #1367
The text was updated successfully, but these errors were encountered:
Information:
Does the latest version of Prism from the download page also have this issue?
Yes
Description
Markup templating injects placeholders: stuff like
___PHP0___
.If this is injected inside CSS, CSS Extras picks up on the number and creates a number token for it.
Because the placeholder is no longer a single text token, the placeholder can no longer be tokenised and remains in the resulting text instead of being replaced.
Example
Say we want to highlight this code as php:
Wrapped in HTML like so:
...where
prism.css
refers to any theme, andprism.js
refers to a Prism build including php, markup-templating, and css-extras.Yields:
More info
The problematic line is here:
prism/components/prism-css-extras.js
Line 75 in 3af5d74
It was changed in #1450 8 months ago. But it may have been around for at least 6 years (checking blames up to get to the initial commit). It’s more likely that this was introduced through markup templating in #1367
The text was updated successfully, but these errors were encountered: