Allow img tag (including width/height attribute)

Allow using img tag in markdown and additionally allowing to specify
width and height attribute for elements.
This commit is contained in:
Matthias Bilger
2022-03-10 11:38:08 +01:00
parent 8174da31e8
commit f040b491d4

View File

@ -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)