rouge
rouge copied to clipboard
Double quoted strings within Java text blocks are incorrectly parsed
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
- First reported in https://github.com/junit-team/junit5/issues/3287
- 3rd code example in: https://junit.org/junit5/docs/5.9.3/user-guide/#writing-tests-parameterized-tests-sources-CsvSource