Skip to content

Inline math incorrectly removes newlines #371

Description

@nschloe

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': '$'}
        ]
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions