Skip to content

Commit 8b6263a

Browse files
authored
Fixes niklasvh#2238 niklasvh#1624 - Fix the issue of TextNode content being overlooked in rendering due to being perceived as blank by trim().
1 parent becf919 commit 8b6263a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dom/node-parser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const LIST_OWNERS = ['OL', 'UL', 'MENU'];
1717
const parseNodeTree = (context: Context, node: Node, parent: ElementContainer, root: ElementContainer) => {
1818
for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
1919
nextNode = childNode.nextSibling;
20-
21-
if (isTextNode(childNode) && childNode.data.trim().length > 0) {
20+
// Fixes #2238 #1624 - Fix the issue of TextNode content being overlooked in rendering due to being perceived as blank by trim().
21+
if (isTextNode(childNode) && childNode.data.length > 0) {
2222
// The U tag marks text with a special underline treatment, and it's not possible to get the underline style from the browser's computed style.
2323
const parentStep = 3;
2424
let hasUnderline;

0 commit comments

Comments
 (0)