Skip to content

Commit

Permalink
Fix handling of inline tags that span across block tags
Browse files Browse the repository at this point in the history
Change-Id: I7378d00f977142e638c9a29aa5e2f3896a3e6e5e
  • Loading branch information
jwbth committed Nov 7, 2024
1 parent 7f1e9fe commit 02dae36
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/CommentSkeleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,11 @@ class CommentSkeleton {
}
}

// We should only enclose if there is need: there is at least one inline or non-empty text
// node in the sequence.
if (
!encloseThis &&
((part.isTextNode && part.node.textContent.trim()) || isInline(part.node))
) {
// We should only enclose if there is a need: there is at least one inline or non-empty text
// node in the sequence. Trimming is needed for cases like
// https://en.wikipedia.org/wiki/Special:GoToComment/c-Tazerdadog-20241102185300-Ratnahastin-20241102181500#undefined
// where the parser leaves <s> </s> (<span> </span> for Parsoid) between <dd> tags.
if (!encloseThis && isInline(part.node, true) && part.node.textContent.trim()) {
encloseThis = true;
}
} else {
Expand Down

0 comments on commit 02dae36

Please sign in to comment.