mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-01 14:27:16 -06:00
`InlineObject::Ruby` is written as `<ruby>base<rt>reading</rt></ruby>`, in the base text's run formatting, and `<ruby>`/`<rb>`/`<rt>` are read back into one ruby object, so docx/doc → HTML → doc keeps the annotation. `<rp>` fallback parentheses and the tags are not text; unclosed or half-marked ruby (no `<rt>`, empty `<rt>`, no base) is tolerated and keeps the text it held, with a block boundary closing the element as a browser does. HTML states no alignment, size or raise, so import uses the Phonetic Guide's defaults (centred, half the base size, raised clear of the base text; the run's size, or 10.5 pt when none is stated). The flow model gains `Inline::Ruby`; formats without ruby (RTF, ODT, Markdown, LaTeX) write its base text as before. Tests: `html::tests::ruby_*` and `tests::html_ruby_round_trip`. Docs: file-format-parity (HTML row) and localization-parity (Japanese row).