`" is incorrectly rendered. Instead of producing the expected HTML output with the characters escaped, it strips the content entirely: >>> i...">

Incorrect HTML output for code span containing </> (original) (raw)

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('</>') '

``

'

Expected result:

'<p><code>&lt;/&gt;</code></p>'

Other examples that work correctly:

markdown.markdown('<') ✅ '

<

' markdown.markdown('</') ✅ '

</

' markdown.markdown('</>') ❌ '

``

' markdown.markdown('/>') ✅ '

/>

' markdown.markdown('>') ✅ '

>

'

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!