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

(cmake) Folders starting by a number highlighted incorrectly #4170

Open
jcelerier opened this issue Nov 17, 2024 · 1 comment
Open

(cmake) Folders starting by a number highlighted incorrectly #4170

jcelerier opened this issue Nov 17, 2024 · 1 comment
Labels
bug help welcome Could use help from community language

Comments

@jcelerier
Copy link

Describe the issue
Folders starting by a number are highlighted incorrectly in CMake.

Exemple:

image

Notice how the 3 at the beginning of 3rdparty is highlighted differently.

Which language seems to have the issue?

cmake

Are you using highlight or highlightAuto?

Ayu highlighting through mdbook... I don't know sorry.

Sample Code to Reproduce

project(my_app)

# example of folder structure
add_subdirectory(3rdparty/libremidi)

add_executable(my_app src/main.cpp)

target_link_libraries(my_app PRIVATE libremidi)

Expected behavior
File names in CMake function calls are highlighted normally.

@jcelerier jcelerier added bug help welcome Could use help from community language labels Nov 17, 2024
@joshgoebel
Copy link
Member

I wonder if something like this would be sufficeint:

      {
        ...hljs.NUMBER_MODE,
        begin: /\b\d+(\.\d+)?\b/
      }

IE, just use a \b word boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

No branches or pull requests

2 participants