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 support for raw/verbatim blocks in Jinja/Twig #1003

Merged
merged 4 commits into from
Jun 10, 2019

Conversation

robin850
Copy link
Contributor

Hello,

This pull request adds proper support for raw and verbatim blocks inside the Jinja and Twig lexers.

For Jinja:

capture d ecran 2018-09-23 a 17 22 45

For Twig:

capture d ecran 2018-09-23 a 17 22 28

Fixes #982
Fixes #983

Have a nice day !

lib/rouge/lexers/jinja.rb Outdated Show resolved Hide resolved
@pyrmont pyrmont added the author-action The PR has been reviewed but action by the author is needed label Jun 4, 2019
Jinja provides a `raw` tag and Twig provides a `raw` tag in its
1.x version and a `verbatim` one in newer versions.

To make the code simple, since the Twig lexer extends from the Jinja
one, the latter holds the logic for both tags.
@pyrmont pyrmont added needs-review The PR needs to be reviewed and removed author-action The PR has been reviewed but action by the author is needed labels Jun 10, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Jun 10, 2019

@robin850 I submitted a PR to your branch with some suggested changes. That seemed preferable to making you copy and paste my code :) You can ask me questions on that PR or wherever is easiest.

@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Jun 10, 2019
@pyrmont pyrmont merged commit b49c9b8 into rouge-ruby:master Jun 10, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Jun 10, 2019

Thanks for the PR, @robin850. Sorry it took such a long time to get it merged in!

@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Jun 10, 2019
@robin850 robin850 deleted the twig-jinja-raw-blocks branch June 10, 2019 20:15
@robin850
Copy link
Contributor Author

No problem, thanks for all your work on this project !

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.

Jinja syntax highlight does not support raw blocks Twig lexer is missing support for the verbatim tag
4 participants