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: Include special characters in syntax highlighting #404

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

Mitcheljager
Copy link
Owner

Keywords with special accents were not being highlighted as expected. This PR fixes that by including these characters in the regex. It's a bit of a ChatGPT special, but it seems to work well.

Before After
image image

@netux
Copy link
Contributor

netux commented Feb 7, 2024

Did you give ChatGPT a list with the name of all heroes and asked it to give you the range of characters their names contain?

Everything in red is being captured by the new ranges. Do we really need Ø and ø?

@Mitcheljager
Copy link
Owner Author

@netux I didn't, no. I just asked it to accept characters with accents. I suppose we don't really need those characters, but they don't hurt either I suppose

@netux
Copy link
Contributor

netux commented Feb 7, 2024

I suppose we don't really need those characters, but they don't hurt either I suppose

In that case then why not add the rest of the latin alphabet? 😅
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape

@Mitcheljager
Copy link
Owner Author

@netux Because I didn't think of it! Updated it

@Mitcheljager Mitcheljager merged commit 0f03716 into master Feb 7, 2024
9 checks passed
@Mitcheljager Mitcheljager deleted the fix/include-special-characters branch February 7, 2024 12:17
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.

2 participants