From f040b491d41ac7efcac916bc31e08eed55de3b6b Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Thu, 10 Mar 2022 11:38:08 +0100 Subject: [PATCH] Allow img tag (including width/height attribute) Allow using img tag in markdown and additionally allowing to specify width and height attribute for elements. --- cookbook/helper/template_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/helper/template_helper.py b/cookbook/helper/template_helper.py index fc94cc89..df35ce68 100644 --- a/cookbook/helper/template_helper.py +++ b/cookbook/helper/template_helper.py @@ -39,7 +39,7 @@ def render_instructions(step): # TODO deduplicate markdown cleanup code instructions = step.instruction tags = markdown_tags + [ - 'pre', 'table', 'td', 'tr', 'th', 'tbody', 'style', 'thead' + 'pre', 'table', 'td', 'tr', 'th', 'tbody', 'style', 'thead', 'img' ] parsed_md = md.markdown( instructions, @@ -48,7 +48,7 @@ def render_instructions(step): # TODO deduplicate markdown cleanup code UrlizeExtension(), MarkdownFormatExtension() ] ) - markdown_attrs['*'] = markdown_attrs['*'] + ['class'] + markdown_attrs['*'] = markdown_attrs['*'] + ['class', 'width', 'height'] instructions = bleach.clean(parsed_md, tags, markdown_attrs)