-
Notifications
You must be signed in to change notification settings - Fork 657
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-text-4] hyphenate-character doesn't just put hyphen at end of line #2975
Comments
I hope we don’t need a new property or new syntax for this. Can the UA use the lang attribute and just do the right thing? |
Yes, that's what i was assuming for the normal case, ie. where you're doing what a language normally does during hyphenation. If you're using |
Isnʼt that quote more about not adding an additional hyphen when you are, for instance, breaking an already hyphenated word? |
Would |
@Crissov I almost wrote another issue about this, but in the sentence
'between parts of hyphenated words' is somewhat ambiguous, but i assumed the sentence refers to strings defined using |
@litherum it may be worth noting that presumably the UA has to do its own thing to an extent anyway, since it needs to change things in Dutch like cafeetje → café-tje, autootje → auto-tje, or skiërs → ski-ers, not ski-ërs. Maybe that would also apply to the position of the 'hyphen' at line end/start. |
IIUC this was one of the motivations @litherum proposed keywords for |
Unicode Standard, v11, p536:
|
Given the point of hyphenate-character is to allow overriding the current language's default hyphen, I'm not sure you can just rely on the language to do the right thing.
But I really like @Crissov's (low-key) idea of using a newline. If the hyphenate-character has a newline, split at the first newline and put the first half and the end of the first line, and the second half at the start of the second line. If not, it goes at the end of the first line. Covers every situation, and no new property required.
Welcome to Llanfair... |
I'm a bit uncomfortable with this, as it's impossible for an author to know whether this extended functionality is supported or not; given that it's a fairly obscure case, and may involve some implementation complexity, it may be preferable to make it clearly distinct from the "normal" case where the An alternative way to extend the property would be to allow an optional second value; if two strings are provided, then the first string (which could be empty) appears before the break, and the second string after the break. This allows for graceful degradation in the usual CSS way if the browser doesn't support the extended syntax. |
My preference here is to leave the position of a single-string value up to the language, and only replace the character rather than changing its insertion behavior. If we want control over where it goes, though, things get a bit more complicated. I agree with @jfkthame that if we're having separate values for before/after the break, it would make sense to use two strings to indicate that. But then how do we handle rules such as “hyphenation character goes on the first line, unless the word was hyphenated already in which case it goes on both lines”? |
Agenda+ to propose that a single-string value only changes what character is inserted, and does not change where it is inserted. |
The CSS Working Group just discussed
The full IRC log of that discussion<emeyer> Topic: hyphenate-character doesn't just put hyphen at end of line<emeyer> github: https://github.com//issues/2975 <emeyer> fantasai: Last two comments on issue clarify that single-string value changes what is inserted, but not where <jfkthame> +1 <emeyer> Rossen_: Any opinions? <emeyer> florian: I think it’s the right thing to do for now <emeyer> …When we look into expansions, we’ll need to think harder about whether this is a novelty thing or about symbols in other languages <emeyer> RESOLVED: A single-string value changes what is inserted, but not where <florian> s/symbols in other languages/manually defining hyphenation in unsupported languages/ |
Made the fix in 2a23164. Let me know if there's anything wrong with it. |
8.1. Hyphens: the hyphenate-character property
https://drafts.csswg.org/css-text-4/#hyphenate-character
I can't find an example at the moment, but i'm pretty sure i have come across languages that put the hyphen at the beginning of the second line, rather than before the hyphenation break. This appears to be supported by the Unicode Standard, which says:
The text was updated successfully, but these errors were encountered: