[Enhancement] Readjust few new tokens for HTML
See original GitHub issueHello @Golmote, @RunDevelopment, @mAAdhaTTah and @zeitgeist87!
Description
In reference to https://github.com/dracula/prism/issues/11, I followed the Dracula’s specific documentation. Imitating and mimicking the HTML syntax highlighting in VSCode, there are small differences between Prism’s HTML and VSCode’s HTML syntax highlightings. See the alternatives with solutions:
Alternatives
-
Using Dracula theme, compare
<!DOCTYPE html>
, entirely highlighted as pink by the classtoken.doctype
in Prismjs, but in VSCode, it is different:Solution:
- You should maintain the class
token.doctype
, which will regex the whole<!DOCTYPE html>
, but; - You should create the new class
token.doctype-name
which will regexDOCTYPE
ordoctype
; - You should create the new class
token.doctype-html
which will regexhtml
.
- You should maintain the class
-
Observe the same images, you can see the different colour of
=
(equal symbol) and of quotation marks, which belong to the classtoken.punctuation
, of which brackets and parentheses also make part. But to get the same result, you should separate the equal symbol and the quotation marks from thetoken.punctuation
only if you addlanguage-html
,language-markup
andlanguage-php
.Solution:
- Create the new class
language-xxx
(html
,markup
andphp
)token.punctuation-equal
for equal symbol; - Create the new class
language-xxx
(html
,markup
andphp
)token.punctuation-quotes
for quotation marks.
- Create the new class
-
Using the Dracula theme ASCII codes are highlighted as pink, and declared by the class
.token.entity
by Prismjs, while Dracula’s specific documentation’sHtmlTags
declares the colour as purple, as we see in VSCode. If I change the colour to purple, all the entities also will become purple, the ASCII codes should be separated from the classes, the entities and the functions.Solution:
- Separate the ASCII codes (beginning with
&
and&#
and ending with;
) from the entities and create the new classtoken.ascii
.
- Separate the ASCII codes (beginning with
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Hello @RunDevelopment
You figured and got it. Thank you! I’m going to test it.
So the normal color of all entities is pink and only the unnamed entities in markup are purple? Like this: