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
1 change: 1 addition & 0 deletions src/dom-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export function wrapTextNodes(block) {
'UL', 'OL',
'PICTURE',
'TABLE',
'BLOCKQUOTE',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
];

Expand Down
18 changes: 18 additions & 0 deletions test/dom-utils/wrapTextNodes.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ <h3>headings of all levels will not be wrapped</h3>
<div></div>
</div>
</div>
<div class="blockquotes original">
<div>
<div><blockquote>a blockquote will not be wrapped</blockquote></div>
</div>
</div>
<div class="blockquotes expected">
<div>
<div><blockquote>a blockquote will not be wrapped</blockquote></div>
</div>
</div>
</div>
</main>
<script type="module">
Expand Down Expand Up @@ -168,6 +178,14 @@ <h3>headings of all levels will not be wrapped</h3>

expect(original.innerHTML).to.equal(expected.innerHTML);
});

it('does not modify blockquotes', () => {
const original = document.querySelector('.original.blockquotes');
const expected = document.querySelector('.expected.blockquotes');
wrapTextNodes(original);

expect(original.innerHTML).to.equal(expected.innerHTML);
});
});
</script>

Expand Down