Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #214 - Nested paragraphs not work correctly inside arbitrary html #215

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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