-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
const div = document.createElement('div');
div.innerHTML = `text1 text2`;
Splitting({ by: 'words', key: 'yeah', target: div });
console.log(div.outerHTML);produces:
<div class=\"words splitting\" style=\"---yeahword-total: 2;\"><span class=\"word\" data-word=\"text1\" style=\"---yeahword-index: 0;\">text1</span><span class=\"whitespace\"> </span><span class=\"word\" data-word=\"text2\" style=\"---yeahword-index: 1;\">text2</span></div>when it should instead produce:
<div class=\"words splitting\" style=\"--yeah-word-total: 2;\"><span class=\"word\" data-word=\"text1\" style=\"--yeah-word-index: 0;\">text1</span><span class=\"whitespace\"> </span><span class=\"word\" data-word=\"text2\" style=\"--yeah-word-index: 1;\">text2</span></div>It happens with by: 'chars' too.
Metadata
Metadata
Assignees
Labels
No labels