syntaxhighlighter icon indicating copy to clipboard operation
syntaxhighlighter copied to clipboard

Valid JavaScript syntax not being parsed correct

Open gaurav1984 opened this issue 4 years ago • 1 comments

Reported here https://wordpress.org/support/topic/valid-javascript-syntax-not-being-parsed-correct

On the code block on this page ( https://netsuite.smash-ict.com/learn-how-to-generate-meaningful-amortization-journal-entry-memo-lines/) , the Javascript syntax highlighting breaks from line 26 for no obvious reason.

Screenshot / Video

Markup on 2021-10-29 at 17:43:36

gaurav1984 avatar Oct 29 '21 12:10 gaurav1984

This can be reproduced with latest version of SyntaxHighlighter and using the following snippet using JavaScript syntax:

// This is a comment with a ' single quote
const CONSTANT = 'Any string between single quotes';
log.debug('Other single quotes string');
image

Looks like it has to do with a preceding comment containing a single quote followed by two strings defined by single quotes.

aaronfc avatar Feb 18 '22 13:02 aaronfc