Splitting icon indicating copy to clipboard operation
Splitting copied to clipboard

Soft hyphens (­) are output as visible characters

Open fthues opened this issue 3 years ago • 1 comments

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):

Screenshot 2022-01-05 at 13 50 47 Screenshot 2022-01-05 at 13 50 39

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

Screenshot 2022-01-05 at 13 56 13

Is there a way to ignore the ­s when processing the DOM?

Edit: This is Chrome/macOS. Seems fine on Firefox.

fthues avatar Jan 05 '22 13:01 fthues

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 &shy; would need to be wedged back in between the generated <span class="char">s..

fthues avatar Jan 05 '22 13:01 fthues