code-input icon indicating copy to clipboard operation
code-input copied to clipboard

With highlight.js, SpecialChars will disappear after creation (perhaps to do with SelectTokenCallbacks)

Open WebCoder49 opened this issue 5 months ago • 2 comments

Using these special characters (all ASCII chars from 0000 to 007F), on Firefox 140:

   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Out of the full-plugin demos here, only with highlight.js and not with Prism.js, selecting text in the <textarea> or pressing arrow keys (but not adding/deleting text which changes the value and causes a rehighlight) causes:

  • the special characters to disappear and stop taking up space in the highlighted element.
  • This is a vague description and the characters disappear at some other times, too, but with little pattern; sometimes some but not all of the characters disappear.
  • This may be to do with SelectTokenCallbacks, since inspecting the element shows code-input_select-token-callbacks_temporary-span elements in the highlighted element.
Screenshot

WebCoder49 avatar Jul 15 '25 14:07 WebCoder49

I cannot reproduce it on the same browser with only the SpecialChars plugin.

WebCoder49 avatar Jul 18 '25 16:07 WebCoder49

This is part of #106.

WebCoder49 avatar Jul 18 '25 21:07 WebCoder49