Skip to content

[css-ruby] White space collapse between ruby annotations #1909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
upsuper opened this issue Oct 27, 2017 · 4 comments
Closed

[css-ruby] White space collapse between ruby annotations #1909

upsuper opened this issue Oct 27, 2017 · 4 comments
Labels
Closed Rejected as Wontfix by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-ruby-1 Current Work

Comments

@upsuper
Copy link
Member

upsuper commented Oct 27, 2017

Copy from my email to www-style:

It seems the current spec is not very clear about how white space collapse should happen on ruby annotations.

There is a sentence says "Where undiscarded white space is collapsible, it will collapse following the standard white space processing rules", but I don't find anywhere mentions the normal white spaces inside ruby annotation.

Let's see an example. If we have a ruby tag like:

<ruby>
  <rb>a</rb><rb>b</rb>
  <rt>x␣</rt><rt>␣y</rt>
</ruby>

If we consider the two ruby text boxes are in the same line, and thus use the standard processing rules to handle the white spaces here, we would get the same result as:

<ruby>
  <rb>a</rb><rb>b</rb>
  <rt>x␣</rt><rt>y</rt>
</ruby>

But it doesn't seem to make sense having a different result between this code and

<ruby>
  <rb>a</rb><rt>x␣</rt><rb>b</rb><rt>␣y</rt>
</ruby>

Hence I propose that we do not collapse white space across the boundary of ruby text box.

@upsuper upsuper added the css-ruby-1 Current Work label Oct 27, 2017
@upsuper
Copy link
Member Author

upsuper commented Oct 27, 2017

@kojiishi's reply:

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.

And my reply to Koji:

No, not from real use cases. I noticed this when I was fixing some bug related to ruby with whitespace, and the behavior I proposed is what Gecko currently implemented.

@upsuper
Copy link
Member Author

upsuper commented Oct 27, 2017

Since whitespace should rarely show up in ruby annotations, especially at the beginning, we can probably just ignore it, or mention that it is implementation-dependent?

@fantasai
Copy link
Collaborator

fantasai commented Feb 2, 2021

Since whitespace should rarely show up in ruby annotations, especially at the beginning, we can probably just ignore it, or mention that it is implementation-dependent?

White space is important for annotations that aren't CJK, though. :)

The spec currently implies that white space collapses across annotations which are adjacent in the markup, and this is I think appropriate. It also implies that they don't collapse across annotations which belong to different ruby segments, and I think this is also appropriate. When annotations and bases are adjacent in the source markup, they're assumed to be part of the same "word", and are allowed to collapse together depending on 'ruby-merge'. For separate ruby segments, however, we don't know whether the author intended them as separate words or not and have to assume they're independent.

What we don't cover though is handling white space collapsing at the beginning and end of a segment. Should that collapse away? If there is a need to keep some spacing between the segments, it could maybe be handled by #3498 ...

@upsuper
Copy link
Member Author

upsuper commented Feb 7, 2021

That's fair. I guess we can probably close this then.

@frivoal frivoal added Closed as Retracted When the person who raised the issue thinks that there's no issue after all. Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. labels Feb 11, 2021
@frivoal frivoal closed this as completed Feb 11, 2021
@fantasai fantasai added Closed Rejected as Wontfix by Editor Discretion and removed Closed as Retracted When the person who raised the issue thinks that there's no issue after all. labels Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Rejected as Wontfix by Editor Discretion Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-ruby-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants