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

🪲 Fix highlighting of keywords with spaces #5190

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Feb 28, 2024

To highlight words that have spaces in them, we actually replace the spaces with | and use a regex to match the keyword. The problem arose there, since I used a string and not a regex, which caused only the first occurrence of the space to be replaced 😵

Fixes #5189

How to test

I added a test in Spanish, but you can also go to level 15, set the language to Spanish and paste this code:

l = 1, 2, 3
si 4 not in l

And it should be highlighted correctlty!

Copy link
Member

@Felienne Felienne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

image

Copy link
Contributor

mergify bot commented Mar 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Mar 5, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 31738f2 into main Mar 5, 2024
11 checks passed
@mergify mergify bot deleted the fix_not_in_highlighter branch March 5, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🪲 Not in not being highlighted properly when using English keywords
2 participants