Skip to content

Commit

Permalink
Fixes niklasvh#2238 niklasvh#1624 - Fix the issue of TextNode content…
Browse files Browse the repository at this point in the history
… being overlooked in rendering due to being perceived as blank by trim().
  • Loading branch information
xweiba authored Jul 17, 2024
1 parent becf919 commit 8b6263a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom/node-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const LIST_OWNERS = ['OL', 'UL', 'MENU'];
const parseNodeTree = (context: Context, node: Node, parent: ElementContainer, root: ElementContainer) => {
for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
nextNode = childNode.nextSibling;

if (isTextNode(childNode) && childNode.data.trim().length > 0) {
// Fixes #2238 #1624 - Fix the issue of TextNode content being overlooked in rendering due to being perceived as blank by trim().
if (isTextNode(childNode) && childNode.data.length > 0) {
// 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.
const parentStep = 3;
let hasUnderline;
Expand Down

0 comments on commit 8b6263a

Please sign in to comment.