Skip to content

Fix bug in Leaf keyword highlighting #4248

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

fpseverino
Copy link

@fpseverino fpseverino commented Apr 28, 2025

Changes

Fix a bug in the Leaf syntax where keywords are highlighted when at the start of a variable name (see the third code block here)

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md

Sorry, something went wrong.

@joshgoebel
Copy link
Member

Thanks! Please also add a changelog entry as well as markup test case.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@fpseverino
Copy link
Author

Please also add a changelog entry as well as markup test case.

@joshgoebel done! I hope I did it correctly

@joshgoebel
Copy link
Member

Except we need a test that would have failed before - so that we prevent this regression in the future... so we need an example of what would have failed before.

@fpseverino
Copy link
Author

#elseif(index == "Welcome back!"):

This would have failed, as the in in index would have been highlighted as a keyword.
There was already in the test another case in which in is correctly highlighted as a keyword.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@joshgoebel
Copy link
Member

Ah, I see. :)

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

3 files changed

Total change +60 B

View Changes
file base pr diff
es/languages/leaf.min.js 435 B 464 B +29 B
highlight.min.js 8.23 KB 8.23 KB +1 B
languages/leaf.min.js 439 B 469 B +30 B

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@fpseverino
Copy link
Author

@joshgoebel do we need anything else to get this merged?

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.

None yet

3 participants