Skip to content

Commit

Permalink
fix #214 - Nested paragraphs not work correctly inside arbitrary html (
Browse files Browse the repository at this point in the history
  • Loading branch information
m-architek authored and quantizor committed Oct 10, 2018
1 parent 56c99dd commit d6231a9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions __snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,19 @@ exports[`markdown-to-jsx compiler arbitrary HTML #207 handles tables inside HTML
`;
exports[`markdown-to-jsx compiler arbitrary HTML #214 nested paragraphs work inside html 1`] = `
<div data-reactroot>
<p>
Hello
</p>
<p>
World
</p>
</div>
`;
exports[`markdown-to-jsx compiler arbitrary HTML allows whitespace between attribute and value 1`] = `
<div data-reactroot
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ const BLOCK_SYNTAXES = [
LIST_ITEM_R,
LIST_R,
NP_TABLE_R,
PARAGRAPH_R
];

function containsBlockSyntax (input) {
Expand Down
16 changes: 16 additions & 0 deletions index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,22 @@ Text content

expect(root.innerHTML).toMatchSnapshot();
});

it('#214 nested paragraphs work inside html', () => {
render(
compiler(
[
'<div>',
'Hello',
'',
'World',
'</div>',
].join('\n')
)
);

expect(root.innerHTML).toMatchSnapshot();
});
});

describe('horizontal rules', () => {
Expand Down

0 comments on commit d6231a9

Please sign in to comment.