Paged.js generates duplicate content (an example with multiple text elements)
See attached HTML:
- Source html contains two text fragments of
Boatswain Privateer hands Corsair
separated by a<span>
element. - Generated page contains text
Boatswain Privateer hands Corsair
8 times:
This is a very similar bug to https://gitlab.pagedmedia.org/tools/pagedjs/issues/253 but the code that is causing the bug seems to be located here: https://gitlab.pagedmedia.org/tools/pagedjs/blob/master/src/utils/dom.js#L527
indexOfTextNode()
is always pointing to first element in my case.
Now try modifying source HTML and make text fragments differ a bit, and you'll see expected behaviour in indexOfTextNode()
.
HTML for reproducing the issue: pagedjs-bug-duplicated-text-multiple-text-elements.html