In markdown==3.8, a code span containing the string "`</>`" is incorrectly rendered. Instead of producing the expected HTML output with the characters escaped, it strips the content entirely:
>>> import markdown >>> markdown.__version__ '3.8' >>> markdown.markdown('`</>`') '<p>``</p>'
Expected result:
`'<p><code></></code></p>'`
Other examples that work correctly:
>>> markdown.markdown('`<`') ✅ '<p><code><</code></p>' >>> markdown.markdown('`</`') ✅ '<p><code></</code></p>' >>> markdown.markdown('`</>`') ❌ '<p>``</p>' >>> markdown.markdown('`/>`') ✅ '<p><code>/></code></p>' >>> markdown.markdown('`>`') ✅ '<p><code>></code></p>'
This issue appears specific to the combination </>
. Would appreciate any insight into whether this is a known bug, an edge case in the parser, or an intentional (though surprising) behavior. Thanks!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4