From: Patrick Canterino Date: Sun, 20 Feb 2022 11:54:22 +0000 (+0100) Subject: Enabled fenced code in Markdown module and added CSS for this X-Git-Url: https://git.p6c8.net/pcdenotes.git/commitdiff_plain/e74a5d637e542676af6d4c9c6afe4139e83f4e6b Enabled fenced code in Markdown module and added CSS for this --- diff --git a/notes/static/notes/style.css b/notes/static/notes/style.css index 02013e4..d5ad56c 100644 --- a/notes/static/notes/style.css +++ b/notes/static/notes/style.css @@ -42,6 +42,11 @@ article blockquote p:last-child { margin-bottom: 0; } +article pre { + background: #eeeeee; + padding: 0.5em; +} + footer { color: #ffffff; background-color: #212529; diff --git a/notes/templatetags/notes_extras.py b/notes/templatetags/notes_extras.py index 81674b8..2e77f7c 100644 --- a/notes/templatetags/notes_extras.py +++ b/notes/templatetags/notes_extras.py @@ -17,7 +17,7 @@ class EscapeHtml(Extension): @register.filter @stringfilter def markdown(value): - return md.markdown(value, extensions=[EscapeHtml(), 'nl2br']) + return md.markdown(value, extensions=[EscapeHtml(), 'nl2br', 'fenced_code']) @register.filter def month_name(value):