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

Add the C++11 raw string feature to the cpp language #1254

Merged
merged 1 commit into from
Dec 27, 2017

Conversation

zeitgeist87
Copy link
Collaborator

No description provided.

@zeitgeist87
Copy link
Collaborator Author

This should fix issue #1253


Prism.languages.insertBefore('cpp', 'string', {
'raw-string': {
pattern: /R"([^()\ ]{0,16})\([\s\S]*\)\1"/,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to escape the space char in the char class, is there?
Also, the part in the parentheses looks greedy: does this mean R"(foo)"R"(bar)" is a single string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Golmote, thanks for the review. Yes you are correct. My intention was not to escape the space char, but to exclude the backslash. It should be \\ instead of a single \. You are also correct in that R"(foo)"R"(bar)" should not be a single string. I guess my regex skills are getting a bit rusty 😄 I'll fix it...

@Golmote
Copy link
Contributor

Golmote commented Dec 27, 2017

@zeitgeist87 Great! Looks good to me now. 👍

@zeitgeist87 zeitgeist87 merged commit 71595be into PrismJS:gh-pages Dec 27, 2017
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

2 participants