Skip to content

Commit 82058ab

Browse files
committed
Dedent text before passing it to the markdown filter
When using Markdown blocks in a template, this allows the block that be indented correctly without making it pre-formatted.
1 parent 128b712 commit 82058ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

site.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import textwrap
2+
13
import jinja2
24
import yaml
35
from elsa import cli
@@ -24,6 +26,7 @@ def future():
2426

2527
@app.template_filter('markdown')
2628
def convert_markdown(text):
29+
text = textwrap.dedent(text)
2730
result = jinja2.Markup(markdown(text))
2831
return result
2932

0 commit comments

Comments
 (0)