-
-
Notifications
You must be signed in to change notification settings - Fork 274
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I haven't dug into it, but it doesn't render anything close to correct results with splitting.js. jsdom works, though.
To Reproduce
import Splitting from 'splitting';
const div = document.createElement('div');
div.innerHTML = `<em>text1</em> <strong>text2</strong>`;
Splitting({ target: div });
console.log(div.outerHTML);produces:
<div style="--word-total: 0; --char-total: 0;" class="words chars splitting"><em></em><strong></strong></div>Expected behavior
jsdom:
<div style="--word-total: 2; --char-total: 10;" class="words chars splitting"><em><span class="word" data-word="text1" style="--word-index: 0;"><span class="char" data-char="t" style="--char-index: 0;">t</span><span class="char" data-char="e" style="--char-index: 1;">e</span><span class="char" data-char="x" style="--char-index: 2;">x</span><span class="char" data-char="t" style="--char-index: 3;">t</span><span class="char" data-char="1" style="--char-index: 4;">1</span></span></em><strong><span class="word" data-word="text2" style="--word-index: 1;"><span class="char" data-char="t" style="--char-index: 5;">t</span><span class="char" data-char="e" style="--char-index: 6;">e</span><span class="char" data-char="x" style="--char-index: 7;">x</span><span class="char" data-char="t" style="--char-index: 8;">t</span><span class="char" data-char="2" style="--char-index: 9;">2</span></span></strong></div>Device:
- OS: macOS 15.4
- Browser Chrome
- Version 20.0.11
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working