3 ms·
> Copy&paste captures the numeric annotations. I probably should have expected that, but didn't. That's very likely a browser bug. Think about the accessibilit
by derefr 5y ago
> Copy&paste captures the numeric annotations. I probably should have expected that, but didn't.
That's very likely a browser bug. Think about the accessibility implications (for e.g. screen readers) if ruby text was supposed to be modelled in the DOM as being interpolated into the text it's annotating.
I'm not sure what the standard says about how it should be treated, but my guess is that each annotation should be thought of as alternative for the text it annotates — ala the image "alt" and "srcset" attributes, or ala videos with multiple audio tracks in the same language, where one of those is Described Video or director's commentary or whatever.
In other words, the "correct" behavior would likely be that your browser knows the user's language prefs, and then chooses to select (or copy, or speak, etc.) either the text or its annotation, depending on which one the user is more likely to be able to read/understand.
- yorwba 5y ago> Think about the accessibility implications (for e.g. screen readers) if ruby text was supposed to be modelled in the DOM as being interpolated into the text it's annotating. The <rp> tag exists explicitly for the purpose of interpolating the annotations into the text. So e.g. <ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby> will look like 漢字(かんじ) to a client that doesn't support ruby text and a screenreader could read it the same way it would read any other text with parenthetical annotations in it. The standard doesn't actually say what screenreaders are supposed to do, so I guess they could also try something fancy. But they don't have to.