markdown-to-jsx
markdown-to-jsx copied to clipboard
Parser adding an extra line
Hello.
I came across an interesting behavior when playing around with Markdown. Looks like Markdown is breaking my string in a wrong way and it is breaking my the text in an extra unnecessary line.
Using the following string, I got the outcome as displayed by the image above:
'<p style="text-align: left;"><b>The</b> most popular lib</p>'
On the other hand, when I add any content that is not an HTML tag as first child of the <p>
, the break line does not happen:
'<p style="text-align: left;">a<b>The</b> most popular lib</p>'
You can play with this example in this codesandbox: https://codesandbox.io/s/html-react-parser-forked-xocqu
It looks like when the content of the first <p>
tag is another HTML tag, the parser is breaking the following content to another line.
Is this the expected behavior or is it a bug?
Hmm, that does seem like a bug. The "b" tag should be detected as an inline HTML tag and processed accordingly.
Hello,
Just dealing with the same issue but with a custom override this time. Is this going to be fixed at any time soon?
I seem to be running into a similar issue with anchor tags. I was able to work around it using forceInline
but I don't think that's a solution I can use across the board unfortunately (since we do want breaks for stuff like headers).