mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Tweak snippet_details.html to allow for text mode indentation preservation
If someone posts python code, but labels it as text- say something like thus: ``` if blah: print "me!" ``` dpaste was rendering that as ``` if blah print "me!" ``` We may wish to make the snippet-rendered class have {whitespace: pre} styling; regardless if dpaste chooses to do so, this change is necessary so any end consumers can set the styling themselves; to support that, any extra indentation the template adds must be suppressed.
This commit is contained in:
parent
cad8361d03
commit
14076c87e4
1 changed files with 5 additions and 3 deletions
|
@ -70,9 +70,11 @@
|
||||||
Snippet
|
Snippet
|
||||||
======================================================================= -->
|
======================================================================= -->
|
||||||
{% if snippet.lexer == 'text' %}
|
{% if snippet.lexer == 'text' %}
|
||||||
<div class="snippet-rendered">
|
{% comment %}
|
||||||
{{ snippet.content|linebreaksbr }}
|
Note that the interpolation of snippet_content needs to be a single line- downstream may be
|
||||||
</div>
|
using styling that converts snippet-rendered to an effective pre to preserve whitespace indentation.
|
||||||
|
{% endcomment %}
|
||||||
|
<div class="snippet-rendered">{{ snippet.content|linebreaksbr }}</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% include "dpaste/snippet_pre.html" %}
|
{% include "dpaste/snippet_pre.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue