Skip to content

Conversation

@idleberg
Copy link
Contributor

@idleberg idleberg commented Jul 16, 2023

I have identified several highlighting issues and reported them #3821. In my memory, these inconsistencies did not exist in earlier versions, but I could be wrong.

This PR adds some tests to identify the problems Obviously, the highlighting rules need to be updated before a merge, so I consider this PR work in progress.

Specifically, I tried adding block-keywords such as !macro / !macroend to the beginKeywords block, but this did not solve the problem. Could the exclamation mark, as a non-word character cause this problem? Also, defining !macroend before the !macro keyword did not have an effect. I'm looking for some direction on how to tackle these issues!

Changes

  • ✅ add test for macro definitions
  • ✅ add test for runtime condition
  • ✅ fix expected markup for !ifdef keyword
  • ✅ fix issues caused by manual editing
  • ✅ remove unused import

Todo

  • identify and write missing test cases
  • fix specific highlighter issues

Checklist

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

@joshgoebel
Copy link
Member

joshgoebel commented Jul 18, 2023

Could the exclamation mark, as a non-word character cause this problem?

Yes, if using keywords you need to redefine the keyword pattern, see keywords.$pattern in the docs (or source). Such as:

    keywords: {
      $pattern: '[a-zA-Z][a-zA-Z0-9_$%!#]*',
    },

@joshgoebel
Copy link
Member

Closing for inactivity, but we can reopen anytime you have time to revisit this work.

@joshgoebel joshgoebel closed this Mar 21, 2024
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