-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
unclean work with class names (adding unneeded spaces during DOM manipulations) #2383
Copy link
Copy link
Closed
Description
Information:
- Prism version: latest (from the master branch)
- Plugins: none
- Environment: Browser
Description
The way how PrismJS works with class attributes for languages (See: https://github.com/PrismJS/prism/blob/master/components/prism-core.js#L260) is unclean since it introduces unnecessary leading white space, e.g. if the original HTML was:
<pre class="highlight">
<code class="language-css">
some code
</code>
</pre>
After PrismJS.highlightAll() it would become (there are two spaces in front of language-XXX instead of one:
<pre class="highlight language-css">
<code class=" language-css">
some code
</code>
</pre>
It is a minor, mostly cosmetic issue, but it would be nice if PrismJS did the right thing and introduced the leading white space only if there is something in the class line already (and definitely use one space in that case :) )
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels