Merge pull request #1641 from m42e/feature/markdown-img-tag

Allow img tag (including width/height attribute)
This commit is contained in:
vabene1111 2022-03-10 14:41:31 +01:00 committed by GitHub
commit 16b5cd75b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)