scrivo / highlight.php

A port of highlight.js by Ivan Sagalaev to PHP
BSD 3-Clause "New" or "Revised" License
695 stars 45 forks source link

Not highlighting correctly #105

Open alvarotrigo opened 1 year ago

alvarotrigo commented 1 year ago

I posted this issue originally on the the highlight.js repository but I guess the problem is on this port rather than on the JS library itself: https://github.com/highlightjs/highlight.js/issues/3743

Describe the issue

Having something like this:

  const optionToSelect = $options.find(item => item.text ===text);

The whole optionToSelect = $options.find( gets the same color without separating the find function. I'm not using auto-detection.

Picture:

image image

Here's the right coloring using the latest version of the JS component highlight.js. Notice the "find" gets colored. https://jsfiddle.net/chy5nd72/

Sample Code to Reproduce

This is how jsfiddle shows it:

image

This is how Prism.js shows it:

image

Expected behavior It should look more like this:

image image