Skip to content

::first-letter doesn't capture opening-quote+space+letter #21

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

Open
r12a opened this issue Jul 9, 2020 · 2 comments
Open

::first-letter doesn't capture opening-quote+space+letter #21

r12a opened this issue Jul 9, 2020 · 2 comments

Comments

@r12a
Copy link
Contributor

r12a commented Jul 9, 2020

This applies to all languages that add a space between initial punctuation and the text that follows.

When a paragraph begins with a quotation mark or other punctuation and there is a space between it and the first letter, both the punctuation and the space separator should be included in the ::first-letter pseudo element.

Just below is an example in French. There is a tendency to prefer NNBSP (Narrow no-break space) because it is about the right width and prevents incorrect breaking. This should, however, also work when a normal space or the Non-break Space is used.

Screenshot 2021-01-25 at 13 00 35

A similar requirement occurs in Norwegian, although a different punctuation mark is used to indicate the start of the quotation.

Screenshot 2021-01-25 at 13 26 59

The GAP

With an initial «,

  • Gecko highlights punctuation and first letter when the punctuation is followed by no space, by U+0020, and by NBSP. Nothing is highlighted when the gap is a NNBSP.
  • Blink highlights punctuation and first letter when there is no space. When U+0020 or NBSP intervene, nothing is highlighted. When NNBSP is used, only the punctuation is highlighted.
  • Webkit highlights punctuation and first letter when the punctuation is followed by no space, by U+0020, and by NBSP. Only the punctuation is highlighted when the gap is a NNBSP.

With an initial ― (horizontal bar) or — (em space),

  • Gecko highlights punctuation and first letter when the punctuation is followed by no space, by U+0020, and by NBSP. Nothing is highlighted when the gap is a NNBSP.
  • Blink highlights punctuation alone in all three cases.
  • Webkit highlights punctuation alone in all three cases.

Priority

Marking this as advanced because initial-letter styling is not essential. It is, however, common enough to need some attention.

Tests

Interactive test Initial-letter selections capture punctuation and initial letter when separated by space

Action taken

CSS issues:

Bug reports:
BlinkWebkitMozilla

Outcomes

css-pseudo-4 text edited to include any intervening space separators.
browser bugs tbd

@r12a
Copy link
Contributor Author

r12a commented Jul 10, 2020

The first comment in this issue contains text that will automatically appear in one or more gap-analysis documents as a subsection with the same title as this issue. Any edits made to that comment will be immediately available in the document. Proposals for changes or discussion of the content can be made in comments below this point.

Relevant gap analysis documents include:
French

@xfq
Copy link
Member

xfq commented Dec 2, 2021

Added links to browser bug reports.

@r12a r12a moved this to Bug in discussion in Gap-analysis pipeline Jun 20, 2024
@r12a r12a added l:fr French s:latn Latin (script) l:no Norwegian doc:latn Latin script labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bug in discussion
Development

No branches or pull requests

2 participants