Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

C++ not recognized as code-block option #28

Closed
R1dO opened this issue Feb 19, 2022 · 2 comments
Closed

C++ not recognized as code-block option #28

R1dO opened this issue Feb 19, 2022 · 2 comments

Comments

@R1dO
Copy link
Contributor

R1dO commented Feb 19, 2022

While fiddling with the rules for the other 'issue', i found out the c++ parameter was not recognized by the lexer.
The reason is that the ++ part is treated as regexp quantifiers instead of characters. It seems those need to be escaped.

On my end this was solved by adapting the code-block-cpp modules in rst.tmLanguage.json:

		"code-block-cpp": {
-			"begin": "^(\\s*)(\\.{2}\\s+code-block::)\\s*(c|cpp|C|C++|CPP|Cpp)\\s*$",
+			"begin": "^(\\s*)(\\.{2}\\s+code-block::)\\s*(c|c\\+\\+|cpp|C|C\\+\\+|CPP|Cpp)\\s*$",
			"while": "^\\1(?=\\s)|^\\s*$",

This adaption includes the lowercase version, since that one was not recognized as well.

@lextm
Copy link
Contributor

lextm commented Feb 19, 2022

I think you should create a pull request for this.

@trond-snekvik
Copy link
Owner

Closing manually, as GitHub didn't recognize the issue linking.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants