rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.33k stars 735 forks source link

Double quoted strings within Java text blocks are incorrectly parsed #1957

Open sbrannen opened 1 year ago

sbrannen commented 1 year ago

Name of the lexer

Java

Code sample

@CsvSource(delimiter = '|', quoteCharacter = '"', textBlock = """
    #-----------------------------
    #    FRUIT     |     RANK
    #-----------------------------
         apple     |      1
    #-----------------------------
         banana    |      2
    #-----------------------------
      "lemon lime" |     0xF1
    #-----------------------------
       strawberry  |    700_000
    #-----------------------------
    """)
void testWithCsvSource(String fruit, int rank) {
    // ...
}

"lemon lime" is highlighted differently.

Strings enclosed in double quotes (") should not be highlighted differently than the surrounding text block.

FYI: the GitHub syntax highlighter apparently does not support Java text blocks correctly either.

Additional context