Skip to content

Are line breaks in examples ok? #18

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
r12a opened this issue Jun 20, 2024 · 6 comments
Closed

Are line breaks in examples ok? #18

r12a opened this issue Jun 20, 2024 · 6 comments
Labels
Closed: Addressed The issue has been addressed, though not necessarily based on the initial suggestion Decision by: Editor's jugement Issue closed by the Editor judging that there was sufficient agreement / no need for agreement i18n-clreq i18n-jlreq i18n-mlreq i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. Tests: Unneeded This closed issue does not need tests. Type: Editorial Typos, markup errors, rephrasings or reorganizations with no normative effects (class 1 or 2)

Comments

@r12a
Copy link

r12a commented Jun 20, 2024

Various examples in the spec use line breaks to make it easier to read the markup. I remember that we had to remove those line breaks in the early days, since they would distort the rendered output when converted to spaces. I think there was some discussion about use of line breaks subsequently, but i can't remember where we stand at the moment. Perhaps this is described in the HTML spec, but does it apply equally to all styles of markup that are possible with ruby (eg. ones that don't have an rb element)?

I don't think the spec mentions this, either, should it?

@r12a r12a added i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. i18n-clreq i18n-jlreq i18n-mlreq labels Jun 20, 2024
@kidayasuo
Copy link

It was not clear to me what is the issue that was brought up here. If it is about text transform within the ruby element it should be no different from normal text I suppose?

@r12a
Copy link
Author

r12a commented Jun 26, 2024

@kidayasuo when HTML source code is parsed, line breaks may be converted to spaces in the rendered output.

For example, there is no space at the end of the first line below

<p>hello
there</p>

but it is rendered

hello there

This test shows that Gecko, Blink, & WebKit engines add spaces when there are newlines between ruby elements, and Gecko adds a space to the rendered rt when ruby base 'a' is followed by a newline (but not Blink or WebKit).

Screenshot 2024-06-26 at 07 19 47

I tested the examples in the spec and found the following for Firefox, but not for Chrome or Safari). I can't remember which is expected, since i seem to vaguely remember that some space handling was introduced at some point to manage Latin annotations. I wasn't keen to work through all the logic – it may be easier to just change the examples...

  • Example 2, second code snippet: A space appears after měi
  • Example 3: A space appears after ㄋㄠˇ
  • Example 10: misaligned ず, and i think zu
  • Example 11: seems to be a space after San Francisco

hope that helps clarify

@frivoal
Copy link
Collaborator

frivoal commented Jun 26, 2024

I am thinking that this is a bit of a can of worms, and more over a layout can of worms, so it maybe be preferable to rewrite those examples either not to have line breaks at all, or at least to make sure all line breaks and spaces are inter-element spaces, and not within individual bases or individual annotations.

Make it into a one liner:

  • example 2 code bloc 2

Either make it into a one-liner, or close <rb>, <rt>, <rtc> tags (either all of them, or the last one on each line):

  • example 3
  • example 10
  • example 11

@frivoal frivoal added the Needs: Edits A decision has been made, but the editor has yet to reflect it in the specification. label Jun 26, 2024
@kidayasuo
Copy link

Thank you for the clarification. A new line after the base character "a" results in adding a space to the content of the rt element seems like a bug to me (regardless of if it comes from the spac or the implementation)……

@r12a
Copy link
Author

r12a commented Jun 26, 2024

I am thinking that this is a bit of a can of worms, and more over a layout can of worms, so it maybe be preferable to rewrite those examples either not to have line breaks at all, or at least to make sure all line breaks and spaces are inter-element spaces, and not within individual bases or individual annotations.

Yes, that's what i was thinking, too.

frivoal added a commit that referenced this issue Jun 27, 2024
This avoids getting into the (fairly complicated) discussion of white
space processing where that's not relevant.

See #18
@frivoal frivoal added Closed: Addressed The issue has been addressed, though not necessarily based on the initial suggestion Decision by: Editor's jugement Issue closed by the Editor judging that there was sufficient agreement / no need for agreement Type: Editorial Typos, markup errors, rephrasings or reorganizations with no normative effects (class 1 or 2) Tests: Unneeded This closed issue does not need tests. and removed Needs: Edits A decision has been made, but the editor has yet to reflect it in the specification. labels Jun 27, 2024
@frivoal
Copy link
Collaborator

frivoal commented Jun 27, 2024

Addressed by 657377b

@frivoal frivoal closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Addressed The issue has been addressed, though not necessarily based on the initial suggestion Decision by: Editor's jugement Issue closed by the Editor judging that there was sufficient agreement / no need for agreement i18n-clreq i18n-jlreq i18n-mlreq i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. Tests: Unneeded This closed issue does not need tests. Type: Editorial Typos, markup errors, rephrasings or reorganizations with no normative effects (class 1 or 2)
Projects
None yet
Development

No branches or pull requests

3 participants