-
Notifications
You must be signed in to change notification settings - Fork 671
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
[css-pseudo-4] Fine-tuning ::first-letter punctuation pattern matching #5830
Comments
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-pseudo-4] Fine-tuning ::first-letter punctuation pattern matching<tantek> +1 jensimmons. agreed that's a good general methodology <dael> github: https://github.com//issues/5830 <dael> fantasai: Problems riased in terms of matching ::first-letter. Example in an issue a " b". When we added ability to include whitespace we chose to include word spaces <dael> fantasai: Problem is we aren't considering what's on other side of punct. If spec only used to separate makes sense, but not always. We're picking up punct that should be attached to word following. That's a problem. <dael> fantasai: I think exclude word and no-break spaces on following side of letter. Maybe leading side but definitely following <dael> Rossen_: Feedback on this one? <dael> Rossen_: No feedback on it, I guess <tantek> +1 reasoning makes sense <dael> fantasai: Objections to makeing word and no break spaces not included? <dael> jfkthame: No objection but thinking it should be same both before and after letter since that's less confusing. If they want a word space they need to use a different character no matter what <dael> fantasai: Happy to exclude from both sides for consistency. word space isn't the correct character to use typographically anyway <dael> Rossen_: Prop: Exclude word break and no break spaces on either side of the letter <dael> Rossen_: Objections? <dael> RESOLVED: Exclude word break and no break spaces on either side of the letter <dael> fantasai: There are several classes of punct. One we don't want to include is opening punct after first letter. first-letter then { doens't make sense to include. In european lang there's spaces so it doens't matter much. For other lang there is no such thing and we're trying to get first letter. WE have opening punct class and that thosuld be excluded <dael> fantasai: Two ambig classes that are common where I don't know how to handle cleanly. Least we can do is exclude the opening punct <dael> Rossen_: Any feedback? <tantek> +1 on excluding opening puncts <dael> bradk: Sounds reasonable <dael> fantasai: Similar case with dashes. Not quite sure the conventions for dash after first letter. I suspect we want to exclude on following side, but I'm not entirely familiar. On leading side long dashes mark quotations. Not sure on following. Inclenation is also exclude dashes from following punctuation <bradk> I don’t have opinion about dashes <dael> Rossen_: One resolution here? <dael> fantasai: Sure <dael> fantasai: Prop: Exclude dashes and opening punct (ps and pd in unicode) from following <dael> RESOLVED: Exclude dashes and opening punctuation (ps and pd in unicode) from following <dael> fantasai: I think that's if for now on this issue. Will need to come back, I think |
Backslash might be nice alternative, but turns into a yen sign in some fonts. :/
@fantasai Upon revisiting the resolution on this issue, I've identified a potential oversight that could significantly affect Norwegian typography. The decision to exclude both the regular space (U+0020) and the no-break space (U+00A0) from either side of the letter inadvertently limits the utility of the ::first-letter pseudo-element for Norwegian texts. In Norwegian typography, direct speech is often indicated with an n-dash that's separated from the subsequent character by a space. (As discussed in #5154) Due to the challenges of entering special characters on many devices, authors often resort to using a regular space or, at best, a no-break space between the n-dash and the first letter. By excluding these spaces before the letter, we risk rendering the Edit: Opened a separate issue here: #9413 |
In #5154 we updated the spec to include "intervening" white space. Certainly for spaces before the first letter this is correct, but the example of “
A "b"
will haveA "
selected” in @csnardi’s #2164 (comment) shows a real problem with this approach: since we reach out to following punctuation, allowing intervening white space after the first letter means we'll jump a word space and scoop up opening punctuation on the other side. :( I think we definitely need to make this smarter.A few rules we could adopt that could help:
I think we also need to do some more thinking about following Po/Pi/Pf/Pd. E.g. CSS2 and Selectors 3 excluded Pd entirely but we generalized to all of P*. And we actually do need to include Pd before the letter because dashes are frequently used as an opening quotation mark, but is slurping them up into the ::first-letter after the letter correct?
CC @dauwhe @r12a @faceless2 @johannesodland
The text was updated successfully, but these errors were encountered: