mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 14:48:02 -05:00
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:
@@ -39,7 +39,7 @@ def render_instructions(step): # TODO deduplicate markdown cleanup code
|
|||||||
instructions = step.instruction
|
instructions = step.instruction
|
||||||
|
|
||||||
tags = markdown_tags + [
|
tags = markdown_tags + [
|
||||||
'pre', 'table', 'td', 'tr', 'th', 'tbody', 'style', 'thead'
|
'pre', 'table', 'td', 'tr', 'th', 'tbody', 'style', 'thead', 'img'
|
||||||
]
|
]
|
||||||
parsed_md = md.markdown(
|
parsed_md = md.markdown(
|
||||||
instructions,
|
instructions,
|
||||||
@@ -48,7 +48,7 @@ def render_instructions(step): # TODO deduplicate markdown cleanup code
|
|||||||
UrlizeExtension(), MarkdownFormatExtension()
|
UrlizeExtension(), MarkdownFormatExtension()
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
markdown_attrs['*'] = markdown_attrs['*'] + ['class']
|
markdown_attrs['*'] = markdown_attrs['*'] + ['class', 'width', 'height']
|
||||||
|
|
||||||
instructions = bleach.clean(parsed_md, tags, markdown_attrs)
|
instructions = bleach.clean(parsed_md, tags, markdown_attrs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user