Skip to content

Allow newlines for role syntax parsing #269

@matthew-brett

Description

@matthew-brett

I noticed that when my {download} inline markup flows across lines, the parsing fails. For example:

from myst_parser.main import to_html

markdown = """
{download}`Link text <test_long_link.py>`.

Here the link runs across lines, breaking parsing {download}`Here is a short
piece of link text <test_long_link.py>`.
"""

print(to_html(markdown))

generates

p><code class="sphinx-role">{download}[Link text &lt;test_long_link.py&gt;]</code>.</p>
<p>Here the link runs across lines, breaking parsing {download}<code>Here is a short piece of link text &lt;test_long_link.py&gt;</code>.</p>

Is this expected? It does not seem to be the case for Sphinx / ReST parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions