Open
Description
Superscript text is often used for exponents, e<sup>i⁢π</sup>
or 10<sup>9</sup>
. This semantic information is lost when copying to plain text: eiπ
, 109
. When ruby annotation markup was added to HTML, it came with a dedicated element for textual fallback: <rp>
. Can we reuse that for superscript and subscript text?
e<sup><rp>^(</rp>i⁢π<rp>)</rp></sup>
10<sup><rp>**</rp>9</sup>
C<sub><rp>_</rp>6</sub>H <sub><rp>_(</rp>12<rp>)</rp></sup> O<sub><rp>_</rp>6</sup>
<abbr title="madame">M<sup>me<rp>.</rp></sup></abbr>
A quick test in browsers suggests that some (e.g. Chrome, Edge, Firefox) drop the content of the <rp>
element inside <sub>
or <sup>
, which is good, but they don’t copy the hidden text for plain-text pasting, which is very bad. Others (e.g. Safari) display (and, of course, copy) the contents, which means that some CSS would be required for them.