W3C home > Mailing lists > Public > www-style@w3.org > August 2014

Re: A proposed standard for CSS-controlled sentence spacing

From: Christoph P舊er <christoph.paeper@crissov.de>
Date: Thu, 21 Aug 2014 15:35:33 +0200
Cc: "Thomas A. Fine" <fine@head.cfa.harvard.edu>
Message-Id: <A005592C-8B39-48FA-BF7D-AC8546BCEB39@crissov.de>
To: www-style mailing list <www-style@w3.org>
Thomas A. Fine 2013-01-09:
> The javascript relies on finding two spaces between sentences for
> sentence detection.

This is specific to English habits (only).

> This eliminates all sorts of ambiguous situations,


There are at least two ways to unambiguously markup sentences, 
so there would need to be about as many ways in CSS, too.

 <p><phrase>I知 a sentence.</phrase> <phrase>Me too!</phrase></p>

 <p><phrase>I知 a sentence.</phrase><phrase>Me too!</phrase></p>

 <p><phrase>I知 a sentence.</phrase>Me too!</p>

 <p>I知 a sentence.<phrase>Me too!</phrase></p>

 <p>I知 a sentence.<gap> </gap>Me too!</p>

 <p>I知 a sentence.<gap/> Me too!</p>

 <p>I知 a sentence.<gap/>Me too!</p>

 <p>I知 a sentence.&gap; Me too!</p>

 <p>I知 a sentence.&gap;Me too!</p>

> There's no reason why CSS can't directly use 
> the two spaces following terminal punctuation as a way to reliably 
> detect sentences in a way which is fully controlled by the user, 
> and yet trivial at content creation time.

CSS could reliably use a single period followed by any number of whitespace characters as well, 
if all other occurrences are marked up properly.

  <p>I知 a sentence with an <abbr>abbr.</abbr> in the middle, 
     <abbr>i. e.</abbr> interesting. I知 a sentence, too.  
     My 2.0 cents (no space).</p>

  p    {gap-size: 1.4ch;} /* or 壮entence-spacing */
  abbr {gap-size: 0.6ch;}

What about the horizontal tabulator, however?

 <p>I知 a sentence.	Me too!</p>

 p {tab-size: 2; white-space: pre-wrap;}

Maybe a new value for the 層hite-space property would be preferable, 
叢re-space would have a row entry of 鼎ollapse Preserve Wrap in the table 
at <http://dev.w3.org/csswg/css-text/#white-space-property>.

You could also argue that CSS should be able to set the 
(exact or minimum and maximum) size of some of the space characters 
defined by Unicode, besides U+0009.
Received on Thursday, 21 August 2014 13:36:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:45 UTC