Skip to content

Conversation

@lukePeavey
Copy link
Owner

Fix: Splitting text does not work as expected when target elements contain comment nodes. This resulted in empty word and line elements in the split text, and unexpected white space (caused by empty word elements).

Changes:

  • ignore text nodes that contain only white space. The split function already ignores comment nodes. But the white space around comment nodes was causing issues.
  • Add new example and tests with target elements containing comment nodes.

Thanks to @danielkorte for reporting this issue.

Closes #36

Issue: SplitType not working as expected when target elements contain
comment nodes.
@lukePeavey lukePeavey merged commit 14f11c4 into master Jun 24, 2022
@lukePeavey lukePeavey deleted the fix/with-html-comments branch June 24, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

split lines not working if target element contains comment nodes

2 participants