markdown-rs icon indicating copy to clipboard operation
markdown-rs copied to clipboard

Panic with setext heading containing text and JSX tag without matching close

Open begleynk opened this issue 1 year ago • 1 comments

Found a panic with this very specific input:

Hi <>
=====

Resulting panic:

thread 'main' panicked at src/to_mdast.rs:1249:9:
internal error: entered unreachable code: expected heading on stack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Requires parsing with MDX options:

    println!(
        "{:?}",
        markdown::to_mdast(
            "Hi <>\n======",
            &markdown::ParseOptions::mdx()
        )?
    );

I checked back to alpha 16 and the crash is still there, so doesn't look like this is a recent regression.

I can try to take a look into what's going on here, but likely can't get to it until next week earliest.

begleynk avatar Sep 19 '24 13:09 begleynk

Thanks @begleynk! That does indeed seem to be something worth looking into. It could potentially be related to https://github.com/wooorm/markdown-rs/pull/31

ChristianMurphy avatar Oct 09 '24 01:10 ChristianMurphy