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
We're embedding some pyscript inside out markdown, and having some trouble with code comments being rendered as headings:
It appears to be an issue within a custom tag where there is a blank line before the line prefaced with the #
To reproduce:
$ python3
Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mistune
>>> mistune.__version__
'2.0.4'
>>> mistune.html(r'''<some-tag>
...
... # a comment
... something with # a trailing comment
... </some-tag>
...
... ''')
'<some-tag>\n<h1>a comment</h1>\n<p>something with # a trailing comment</p>\n</some-tag>\n'
What is expected:
The code/comments within the custom tags (in our case they're <py-script></py-script>) should not be interpreted as markdown (there weren't in a pre-2.x version of mistune), and produce: <some-tag>\n<p># a comment</p>\n<p>something with # a trailing comment</p>\n</some-tag>\n
When there is no blank line preceeding the code comment, this behavior is not observed:
>>> mistune.html(r'''<some-tag>
... # a comment
... something with # a trailing comment
... </some-tag>''')
'<some-tag>\n# a comment\nsomething with # a trailing comment\n</some-tag>\n'
The text was updated successfully, but these errors were encountered:
We're embedding some pyscript inside out markdown, and having some trouble with code comments being rendered as headings:
It appears to be an issue within a custom tag where there is a blank line before the line prefaced with the
#
To reproduce:
What is expected:
The code/comments within the custom tags (in our case they're
<py-script></py-script>
) should not be interpreted as markdown (there weren't in a pre-2.x version of mistune), and produce:<some-tag>\n<p># a comment</p>\n<p>something with # a trailing comment</p>\n</some-tag>\n
When there is no blank line preceeding the code comment, this behavior is not observed:
The text was updated successfully, but these errors were encountered: