You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a strange bug while using markdown as part of a flask app.
The following code works fine when running in the terminal:
import markdown
import markdown.extensions
value = """
This is a test.[^1]
[^1]: this is a footnote.
"""
result = markdown.markdown(value,
extensions=[
'markdown.extensions.footnotes',
'markdown.extensions.tables',
'markdown.extensions.sane_lists',
]
)
print(result)
But when run as part of a Flask app I get the following error:
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/core.py", line 388, in markdown
return md.convert(text)
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/core.py", line 269, in convert
newRoot = treeprocessor.run(root)
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/extensions/footnotes.py", line 388, in run
footnotesDiv = self.footnotes.makeFootnotesDiv(root)
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/extensions/footnotes.py", line 181, in makeFootnotesDiv
self.parser.parseChunk(surrogate_parent, self.footnotes[id])
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/blockparser.py", line 105, in parseChunk
self.parseBlocks(parent, text.split('\n\n'))
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/blockparser.py", line 123, in parseBlocks
if processor.run(parent, blocks) is not False:
File "/Users/nicholas/projects/quill/venv3.7/lib/python3.7/site-packages/markdown/blockprocessors.py", line 591, in run
p = etree.SubElement(parent, 'p')
TypeError: SubElement() argument 1 must be xml.etree.ElementTree.Element, not Element
If I downgrade to markdown version 3.1, everything works as expected, but upgrading to anything after 3.2 triggers the exception.
Does anyone know what might be going on?
The text was updated successfully, but these errors were encountered:
Supposedly, this was fixed this in tiran/defusedxml#60 and tiran/defusedxml#63. According to their changelog, those changes should be available in difusedxml 0.8.0, whenever that is released.
I've got a strange bug while using markdown as part of a flask app.
The following code works fine when running in the terminal:
But when run as part of a Flask app I get the following error:
If I downgrade to markdown version 3.1, everything works as expected, but upgrading to anything after 3.2 triggers the exception.
Does anyone know what might be going on?
The text was updated successfully, but these errors were encountered: