Add a {% code_block %} template tag.
Review Request #11905 — Created Jan. 4, 2022 and submitted — Latest diff uploaded
This is a block tag that runs the nested content through Pygments, using
the provided lexer name. This makes it easier to include code samples in
templates without hard-coding Pygmentsspan
tags.
Unit tests pass in Python 2 and 3.
Tested this with a template being written for another change. Verified that
the rendering used the correct lexers.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.
orig
1
2
3
Commits
reviewboard/reviews/templatetags/reviewtags.py |
---|
reviewboard/reviews/tests/test_reviewtags.py |
---|