Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

I want better french typography support #259

Closed
aarongustafson opened this issue Jan 10, 2021 · 2 comments · Fixed by #329
Closed

I want better french typography support #259

aarongustafson opened this issue Jan 10, 2021 · 2 comments · Fixed by #329
Assignees
Labels
want Incoming requests from the community

Comments

@aarongustafson
Copy link
Member

aarongustafson commented Jan 10, 2021

Browsers localize automatically quotation marks if a lang attribute is provided which is great, but we can do much more to enhance and simplify experience of developers but also authors on the web.

In French, exclamation and question mark both require a non-breaking space before them, on the contrary of English. Often, people on the web use normal space which create orphan sign at the end of a new line.

Currently, developers aware of this problem solve it by:

  • Replacing space characters before ! and ! in text with   or \xa0
  • Using white-space: nowrap; CSS property and adding an HTML element encompassing the last word and the sign ! or ? of a sentence
  • Use no space

Some links to illustrate the issue:

HTML authoring in French
Whitespace before some punctuation characters in French: is there a CSS way to avoid lines breaking? - Stack Overflow
Space Yourself


https://webwewant.fyi/wants/5ffb01b21e3e3f6db4eb6404/

@aarongustafson aarongustafson added the want Incoming requests from the community label Jan 10, 2021
@aarongustafson aarongustafson self-assigned this Jan 10, 2021
@captainbrosset
Copy link
Collaborator

This seems to me like a fair request.
As the author of the want said, the following html code will produce different results if you change the value of the lang attribute:

<!DOCTYPE html>
<html lang="fr">
  <head>
     <meta charset="utf8">
  </head>
  <body>
    <q>this is a quote</q>
  </body>
</html>

With fr:
image

With en:
image

I don't know what authoring mechanism could be put in place for this, but something similar to generate correct sentence endings seems useful.

@javifernandez
Copy link

javifernandez commented Mar 16, 2021

Hi,
@bkardell asked me to look at this issue, which I agree it's a fair request indeed.

As a matter of fact, what is requested might be the expected behavior for any lang using Unicode. The UAX14 spec states that the exclamation and question marks are defied as EX class, which specifically prohibit breaking before these characters.

EX | Exclamation/ Interrogation | “!”, “?”, etc. | Prohibit line breaks before

Additionally, the white-space character is defined as BA class (break-after), which prohibits breaking before the space.

@WebWeWant WebWeWant deleted a comment from github-actions bot Mar 23, 2021
@WebWeWant WebWeWant locked and limited conversation to collaborators Mar 30, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
want Incoming requests from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants