jinja
jinja copied to clipboard
debug extension pprinting in html
Current debug extension
Currently, when the debug extension is added, {% debug %}
is rendered with a pprint that injects \n
chars. This has the effect that pretty printing is actually seen in places where that end of line char is respected, such as a repl.
I would love a way to get pretty printing in rendered html template, where \n
has no effect. I'd guess this is very common place to want pretty printing, perhaps more common than a repl.
The request:
If we add an optional (keyword) argument to the debug tag, then we can have formatting options, such as pretty printing in an html compatible way, e.g. {% debug 'html' %}
/ {% debug format='html' %}
.