markdown-it-rust / markdown-it

markdown-it js library rewritten in rust
Other
79 stars 9 forks source link

Closing tags versus self-closing tags #14

Closed digitalmoksha closed 1 year ago

digitalmoksha commented 1 year ago

I don't understand how some tests are passing. For example

https://github.com/rlidwka/markdown-it.rs/blob/eb5459039685d19cefd0361859422118d08d35d4/tests/commonmark.rs#L6446-L6453

We're expecting the output to contain <br />. However using cargo run on the input, I get the output

<p><em>foo<br>
bar</em></p>

which outputs a <br>. I must be missing something obvious, because cargo test passes.

digitalmoksha commented 1 year ago

Ok, located where this is happening. The xrender method adds slash to self-closing tags in order to be compatible with CommonMark tests, and it's called explicitly in those tests.

The command line uses render as opposed to xrender.

xrender is public, so if someone wants that behavior they can call it.