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
I'm using the built-in Chroma syntax highlighter but it seems to lack specificity compared to let's say VSCode or Atom. Consider the following example in JavaScript:
As you can see, the output from Hugo/Chroma is limited in terms of how many different ‘elements’ it recognises.
This is confirmed by using the option pygmentsUseClasses=true and inspecting the classes it assigns to elements which are highlighted using different colours in text editors but the same once processed by Hugo/Chroma, for example ‘target’ and ‘offset’ both share the class="nx" even though one is a parameter and the other is a method. Another example is ‘this’ and ‘return’ which are both class="k".
This issue is even more striking if you use some other language like R, which looks like there's no syntax highlighting at all… :(
Is it possible to set up Hugo/Chroma to differentiate between such elements and assign them different classes, please?
The text was updated successfully, but these errors were encountered:
lifepeer
changed the title
Syntax highlighting ‘specificity’ much lower compared to text editors
Syntax highlighting ‘specificity’ lower compared to text editors
Jul 14, 2019
I'm using the built-in Chroma syntax highlighter but it seems to lack specificity compared to let's say VSCode or Atom. Consider the following example in JavaScript:
As you can see, the output from Hugo/Chroma is limited in terms of how many different ‘elements’ it recognises.
This is confirmed by using the option
pygmentsUseClasses=true
and inspecting the classes it assigns to elements which are highlighted using different colours in text editors but the same once processed by Hugo/Chroma, for example ‘target’ and ‘offset’ both share theclass="nx"
even though one is a parameter and the other is a method. Another example is ‘this’ and ‘return’ which are bothclass="k"
.This issue is even more striking if you use some other language like R, which looks like there's no syntax highlighting at all… :(
Is it possible to set up Hugo/Chroma to differentiate between such elements and assign them different classes, please?
The text was updated successfully, but these errors were encountered: