The following JavaScript code:
let hsv2hsl = (h,s,v,l=v-v*s/2, m=Math.min(l,1-l)) => [h,m?(v-l)/m:0,l];
colors are wrong (starting from /2
which is interpreted as comment):
Light mode:
Dark mode:
Update
The duplicate question suggests that I should report this bug directly in the highlight.js GitHub repository - I do it here, but they closed the bug and stated that this will not be fixedhere.
PS: For instance, on JSFiddle, JavaScript coloring works properly - so it is possible.