Inline math incorrectly removes newlines
nschloe opened this issue · comments
Nico Schlömer commented
MWE:
import mistune
from rich import print
markdown = mistune.create_markdown(
renderer="ast",
plugins=["math"],
)
tokens = markdown("$`a+%\nb`$")
print(tokens)
Output:
[
{
'type': 'paragraph',
'children': [
{'type': 'text', 'raw': '$'},
{'type': 'codespan', 'raw': 'a+% b'},
{'type': 'text', 'raw': '$'}
]
}
]