Splitting
Splitting copied to clipboard
Soft hyphens (­) are output as visible characters
We're character-splitting headlines containing ­
soft hyphens. Those are usually invisible and act as a hyphenation hint for the browser.
This is how Califor­nia Dreaming
is rendered, note the extra glyph (U+F8FF):


Different font, same issue (here ­
is rendered as a different glyph):

Is there a way to ignore the ­
s when processing the DOM?
Edit: This is Chrome/macOS. Seems fine on Firefox.
Simply checking for and stripping the offending unicode character (00AD
) from contents
inside the splitText
function works, but then of course the soft hyphen is thrown out completely as if it was never there.
Hm, the unprocessed ­
would need to be wedged back in between the generated <span class="char">
s..