mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Roles that contain line breaks render incorrectly (and produce no errors or warnings)

Open mfisher87 opened this issue 3 weeks ago • 0 comments
trafficstars

Description

MyST version 1.6.3

When a {role} spans multiple lines, it isn't parsed as expected. My editor and formatting tools will happily break a role across multiple lines and break its rendering and I'll have no way of knowing without searching the output for { to find the literally-rendered roles.

We know how to provide JSON data from the server and consume it in a {term}`widget
<widget>`.

Renders as:

Image

To fix:

We know how to provide JSON data from the server and consume it in a
{term}`widget <widget>`.
Image

Proposed solution

Ignore line breaks when parsing roles (just like how inline code can span lines), or throw an error and fail the build when parsing a role and not finding a terminating backtick.

Additional notes

I've only tested the {term} role. I guessed when titling this issue that this could be possible with any role since it seems to be a parsing issue? I don't have proof though :)

mfisher87 avatar Oct 28 '25 16:10 mfisher87