Skip to content

Conversation

@Markus92
Copy link
Contributor

@Markus92 Markus92 commented Jul 29, 2024

The test cases for the turtle lexer did not include triple quoted strings (neither single nor double). The regex used to match the string contents matched every single character except escape characters, but crucially it also matched the triple quotes used to delineate the termination of such a string. The updated regex specifically excludes these characters.

Fixes #2744

Note: the same issue might also occur in the SPARQL lexer. However, I never really use SPARQL so I cannot verify if the same logic would apply.

This is my first contribution to Pygments, forgive me for any mistakes I made. I confirm I agree, am willing and am able to put my contributions under the BSD 2-clause license.

Before:
afbeelding

After:
afbeelding

The test cases for the turtle lexer did not include triple quoted
strings (neither single nor double). The regex used to match the
string contents matched every single character except escape characters,
but crucially it also matched the triple quotes used to delineate the
termination of such a string. The updated regex specifically excludes
these characters.
@Markus92
Copy link
Contributor Author

Markus92 commented Oct 3, 2024

@birkenfeld Any chance you could take a look at this? Thanks!

@birkenfeld
Copy link
Member

LGTM. Thanks!

@birkenfeld birkenfeld closed this Oct 5, 2024
@birkenfeld birkenfeld reopened this Oct 5, 2024
@birkenfeld birkenfeld merged commit 0b9138a into pygments:master Oct 5, 2024
@Anteru Anteru added the A-lexing area: changes to individual lexers label Jan 4, 2025
@Anteru Anteru added this to the 2.19.0 milestone Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lexing area: changes to individual lexers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turtle highlighting does not properly terminate on multi-line strings

3 participants