markdown-to-jsx
markdown-to-jsx copied to clipboard
Markdown line that starts with <u> html tag has inconsistent behavior
There is some behavior that I wouldn't expect when working with markdown with html tags. I added the below tests to index.component.spec.tsx
it('test for markdown paragraph and html tags', () => {
render(
<Markdown
options={{
overrides: {
p: {
component: 'p',
},
},
}}
>
{'Other text <u>Underline</u>\n'}
</Markdown>
)
expect(root.innerHTML).toMatchInlineSnapshot(`
<p>
Other text
<u>
Underline
</u>
</p>
`)
})
it('test for markdown paragraph and start line with html tag', () => {
render(
<Markdown
options={{
overrides: {
p: {
component: 'p',
},
},
}}
>
{'<u>Underline</u> Other text\n'}
</Markdown>
)
expect(root.innerHTML).toMatchInlineSnapshot(`
<p>
<u>
Underline
</u>
Other text
</p>
`)
})
The first test passes as expected. However the second test generates the following:
<div>
<u>
Underline
</u>
Other text
</div>