Re: [csswg-drafts] [css-text] Non-Collapsible Space (#10821)

> [@dgp1130](https://github.com/dgp1130) you can use `‌` to break your spaces. eg `‌ ‌ ‌`
> 
> be warned that all spaces will be visible, even after wrapping.

I considered that in https://github.com/w3c/csswg-drafts/issues/10821#issuecomment-2658269538, but like you mention, the line wrapping behavior isn't right.

> However, have you considered a zero-width space? The [relevant CSS spec](https://drafts.csswg.org/css-text-4/#white-space) explicitly only counts ASCII whitespace (U+0009, U+000A, U+0020, and indirectly U+000D in HTML due to CRLF normalization) as whitespace it can collapse. It doesn't collapse any other code point in Unicode category Zs. So you _may_ be able to get away with using `​`/`​`/`​` as your `&ncsp;`.

My intent behind `&ncsp;` is a normal-width space with typical line wrapping behavior (ie. lines do not start with wrapped spaces). `​` is a way of forcing two whitespace characters to not be collapsed together, but then we need to pick what those two characters are.

I tried interleaving with ` ` in https://github.com/w3c/csswg-drafts/issues/10821#issuecomment-2439793560, but that has the undesirable line wrapping behavior. I also tried [interleaving with regular spaces](https://jsfiddle.net/3q8ysrb6/5/), but that actually has the same undesirable line wrapping behavior (I'm testing in Chrome, but I'm assuming other browsers match).

![A screenshot of the linked demo which shows "Hello" and "World" in a small viewport causing line wrapping. "Hello" is formatted normally, however "World" is effectively indented, with the spaces between the two words having been placed at the start of its line.](https://github.com/user-attachments/assets/910f84e4-e0de-48e6-ba07-402200c95d1e)

-- 
GitHub Notification of comment by dgp1130
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10821#issuecomment-2661086176 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 15 February 2025 20:15:32 UTC