-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS extras combined with markup templating retains placeholders #2008
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: