diff --git a/.changeset/fuzzy-deers-argue.md b/.changeset/fuzzy-deers-argue.md new file mode 100644 index 00000000..4b69c186 --- /dev/null +++ b/.changeset/fuzzy-deers-argue.md @@ -0,0 +1,5 @@ +--- +"markdown-to-jsx": patch +--- + +Fix handling of deeply-nested HTML in some scenarios. diff --git a/index.compiler.spec.tsx b/index.compiler.spec.tsx index 102be7ef..99b593e1 100644 --- a/index.compiler.spec.tsx +++ b/index.compiler.spec.tsx @@ -248,13 +248,13 @@ describe('inline textual elements', () => { render(compiler('**Hello\nWorld.**\n')) expect(root.innerHTML).toMatchInlineSnapshot(` -
- - Hello - World. - -
- `) ++ + Hello + World. + +
+ `) }) it('should handle triple-emphasized text', () => { @@ -3401,13 +3401,13 @@ Item detail ) expect(root.innerHTML).toMatchInlineSnapshot(` -- Item detail - - debug item 1 - -
- `) ++ Item detail + + debug item 1 + +
+ `) }) }) @@ -4342,6 +4342,19 @@ describe('overrides', () => { expect(root.innerHTML).toMatchInlineSnapshot(`"test"`) }) + + it('#520 handle deep nesting', () => { + render(compiler('