Re: [css-ruby] White space collapse between ruby annotations

On Sat, Jul 11, 2015 at 4:13 AM, Myles C. Maxfield <mmaxfield@apple.com>
wrote:

> Ruby runs are partitioned by <rb> elements. Therefore, in your example:
>
> > <ruby>
> >   <rb>a</rb><rb>b</rb>
> >   <rt>x␣</rt><rt>␣y</rt>
> > </ruby>
>
> The first run has a base of "a" with no ruby text.
> The second run has a base of "b" with two ruby texts, "x␣" and "␣y"
> In this case, I believe it makes sense to collapse the whitespace between
> the "x" and the "y."
>

rb and rt are connected by their indexes, so in this example, "a" has "x␣"
and "b" has "␣y".

In your third example:
>
> > <ruby>
> >   <rb>a</rb><rt>x␣</rt><rb>b</rb><rt>␣y</rt>
> > </ruby>
>
> The first run has a base of "a" with a text of "x␣"
> The second run has a base of "b" with a text of "␣y"
> In this case, I believe it doesn't make sense to collapse the whitespace
> between the "x" and the "y."
>

Yeah, so Xidorn's point is that two different way to write markup for the
same semantics causing difference, which does make sense to me.

Is this from real use cases? While it logically makes sense, I guess the
use of spaces in ruby is rare, and putting spaces at the begin/end of <rt>
is even rarer that I'm not excited to add special casing here.

/koji

Received on Thursday, 16 July 2015 07:07:17 UTC