alexgorbatchev/SyntaxHighlighter — Issue #68: Do not highlight numbers which are part of an identifier
Author: orfjackal
Created: 2011-12-16 05:29:03+00:00
State: open

At least the Scala brush sufferent from a case that if there is a variable called `file2` then it would highlight the number 2 from that identifier, resulting in `file` being black and `2` being green (on default theme). The expected behavior would be that the whole identifier is of the same color.

Here is a quick fix for shBrushScala.js, but it would be good to check also the other brushes for similar bugs.

Find:

regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi,

Replace it with:

regex: /\b0x[a-f0-9]+|\b\d+(\.\d+)?/gi,