Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cpp) Fix highlighting of unterminated raw strings #2261

Merged
merged 7 commits into from Apr 27, 2020

Commits on Apr 27, 2020

  1. enh(cpp): Improve highlighting of unterminated raw strings

    PR highlightjs#1897 switched C++ raw strings to use backreferences, however this
    breaks souce files where raw strings are truncated. Like comments, it
    would be preferable to highlight them.
    
    - Add `on:begin` and `on:end` to allow more granular matching when
      then end match is dynamic and based on a part of the begin match
    - This deprecates the `endSameAsBegin` attribute. That attribute was
      a very specific way to solve this problem, but now we have a much
      more general solution in these added callbacks.
    
    Also related: highlightjs#2259.
    
    Co-authored-by: Josh Goebel <me@joshgoebel.com>
    davidben and joshgoebel committed Apr 27, 2020
    Copy the full SHA
    923f8c1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    a6a132a View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    7d5be2c View commit details
    Browse the repository at this point in the history
  4. (parser) make END_SAME_AS_BEGIN a function helper

    Adds a mode helper to replace the deprecated `endSameAsBegin` attribute.
    
    The first match group from the begin regex will be compared to the first
    match group from the end regex and the end regex will only match if both
    strings are identical.
    
    Note this is more advanced functionality than before since now you can
    match a larger selection of text yet only use a small portion of it for
    the actual "end must match begin" portion.
    joshgoebel committed Apr 27, 2020
    Copy the full SHA
    61070a4 View commit details
    Browse the repository at this point in the history
  5. (pgsql) add test for $$ quoting existing behavior

    - even if that existing behavior is questionable
    - the ending span should really close before the $$, not after
    
    Fixing this would involve delving into the sublanguage behavior and I'm
    not sure we have time to tackle that right this moment.
    joshgoebel committed Apr 27, 2020
    Copy the full SHA
    85e60f7 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    b2fc85b View commit details
    Browse the repository at this point in the history
  7. (docs) rename to mode_reference; docs for callbacks

    - I can never find this file because it's name didn't fully match.
    - rename callbacks to `on:begin` and `on:end`
    joshgoebel committed Apr 27, 2020
    Copy the full SHA
    9ada394 View commit details
    Browse the repository at this point in the history