syntaxhighlighter icon indicating copy to clipboard operation
syntaxhighlighter copied to clipboard

2-character single-line does not display

Open cena opened this issue 1 year ago • 3 comments

Regardless of language/brush, entering a single line consisting of a 2-character string does not display on the frontend or in Preview.

The following do display correctly:

  • Entries of 1 character and 3 characters
  • 2/+ lines consisting of 2-character strings:

SCR-20220729-fy2

See also: https://a8c.slack.com/archives/C6GGX896G/p1659100898753839?thread_ts=1659085924.820659&cid=C6GGX896G

Reported in https://wordpress.org/support/topic/two-letters-text-doesnt-show/

cena avatar Jul 29 '22 16:07 cena

I looped @merkushi, and this is what's been shared so far:

  • To fix it we'd need to edit the script, which looks not really doable.
  • As a workaround, we could add a comment to the code to increase the number of symbols in the excerpt.
  • The simplest solution, especially for plain text, is to use Code block.

StefMattana avatar Aug 02 '22 15:08 StefMattana

Just want to add, the problem is inside shCore.js which is part of syntaxhighlighter3. The code of this script is obfuscated. I attach a screenshot of the method that removes content (in the last string, after auto-formatting): CleanShot 2022-07-29 at 17 45 00@2x

merkushin avatar Aug 02 '22 15:08 merkushin

@merkushin the user in the forum thread explained that they need this to recreate a tutorial page for a cloud server. The tutorial separately shows code/command in order and displays those two letters as one of the commands.

Not sure if it's useful but I thought it was worth sharing here.

StefMattana avatar Aug 03 '22 16:08 StefMattana