Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ exports[`keepLineBreaksPlugin absent does not keep line breaks between the items
</div>
`;

exports[`keepLineBreaksPlugin absent does not keep line breaks under a heading 1`] = `
exports[`keepLineBreaksPlugin absent keeps line breaks natively under a heading 1`] = `
<div>
Heading
<h2>
Heading
</h2>


<p>
Expand Down Expand Up @@ -669,7 +671,9 @@ exports[`keepLineBreaksPlugin present keeps line breaks between the items in an

exports[`keepLineBreaksPlugin present keeps line breaks under a heading 1`] = `
<div>
Heading
<h2>
Heading
</h2>


<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ describe('keepLineBreaksPlugin', () => {
const container = doRenderText(orderedListText, present);
expect(container).toMatchSnapshot();
});
it(`does not keep line breaks under a heading`, () => {
it(`keeps line breaks natively under a heading`, () => {
const container = doRenderText(headingText, present);
expect(container).toMatchSnapshot();
});
Expand Down
6 changes: 6 additions & 0 deletions src/components/Message/renderText/renderText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export const defaultAllowedTagNames: Array<
// custom types (tagNames)
'emoji',
'mention',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
];

function formatUrlForDisplay(url: string) {
Expand Down