markdown-to-jsx
markdown-to-jsx copied to clipboard
Cannot render tag if formatted in a certain way.
If we do this
const string = `<p>
Item detail
<span
style="
color: #fddb67;
font-size: 11px;
font-style: normal;
font-weight: 500;
line-height: 18px;
text-decoration-line: underline;
"
>debug item 1</span
>
</p>`;
<Markdown>{string}</Markdown>
This error would be thrown
But if we inline the entire string, the content is rendered correctly with no errors
const string = `<p> Item detail <span style=" color: #fddb67; font-size: 11px; font-style: normal; font-weight: 500; line-height: 18px; text-decoration-line: underline; ">debug item 1</span> </p>`;
Not sure why this happens, but we were using another library and it was rendering the first version just fine.
I wonder if this is the same as #449.
If you put your markdown in here: https://markdown-to-jsx.quantizor.dev/
The output you get is: Item detail debug item 1</span > </p>
@quantizor is this an issue you are aware about? Do you have any thoughts on it? For me it is currently something that prevents me from using the library which I would otherwise be very happy to use
Hi, yes likely a case of some regexes not accounting for newlines properly. Will look into it