Closed nixxquality closed 5 months ago
I noticed nesting issues once I highlighted some real code (d'oh) and I believe I've fixed it now by merging together a bit with the earlier work. I added more test cases to cover this.
Changes to minified artifacts in /build
, after gzip compression.
Total change +67 B
Changes to minified artifacts in /build
, after gzip compression.
Total change +82 B
Changes to minified artifacts in /build
, after gzip compression.
Total change +82 B
Sorry about the delay. I removed the examples that had broken syntax per your request and I also added some more real code that acts as a test case for leaving CHAR_LITERAL out of the BLOCK_STATEMENT array.
I've noticed that Erlang's character literals have been ignored and caused havoc in highlighting before, see example fiddle: https://jsfiddle.net/k5xm69vu/1/
Strangely enough, the best documentation I could find for this syntax feature was the Erlang module that parses its own syntax... but anyway, here it is: https://www.erlang.org/doc/man/erl_syntax#char-1I was reading another part of the documentation and happened to find it: https://www.erlang.org/doc/reference_manual/data_types#number (the scratched out link above is also helpful as it mentioned the octal syntax) It's similar to the char literal in C, but the syntax is a $ followed by either (a character) or (a backslash and (a character or up to 3 digits)). The character can be anything, from alphanumerics to whitespace. If there's a backslash that means you've escaped some value and the 3 digits let you specify an exact octal character number. There were a few edge cases I had to work out but I believe this is now the final version.You can compare the markup tests to the following REPL output:
I followed the guide on https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html to assign this new check the "string" class because it's supposed to apply to "literal string, character".
Checklist
CHANGES.md