From 919662054c2d267c6968537038011c20074ab2ad Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 1 Feb 2020 14:49:28 +1100 Subject: [PATCH] Alter markdownify settings to properly render images, headings --- InvenTree/InvenTree/settings.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 7c136744e1..dbb1f96aa6 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -165,9 +165,37 @@ REST_FRAMEWORK = { WSGI_APPLICATION = 'InvenTree.wsgi.application' -# Markdown configuration +# Markdownx configuration +# Ref: https://neutronx.github.io/django-markdownx/customization/ MARKDOWNX_MEDIA_PATH = datetime.now().strftime('markdownx/%Y/%m/%d') +# Markdownify configuration +# Ref: https://django-markdownify.readthedocs.io/en/latest/settings.html + +MARKDOWNIFY_WHITELIST_TAGS = [ + 'a', + 'abbr', + 'b', + 'blockquote', + 'em', + 'h1', 'h2', 'h3', + 'i', + 'img', + 'li', + 'ol', + 'p', + 'strong', + 'ul' +] + +MARKDOWNIFY_WHITELIST_ATTRS = [ + 'href', + 'src', + 'alt', +] + +MARKDOWNIFY_BLEACH = True + DATABASES = {} """