Re: A proposed standard for CSS-controlled sentence spacing

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,

Typos?

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’m a sentence.</phrase> <phrase>Me too!</phrase></p>

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

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

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

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

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

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

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

 <p>I’m 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’m a sentence with an <abbr>abbr.</abbr> in the middle, 
     <abbr>i. e.</abbr> interesting. I’m a sentence, too.  
     My 2.0 cents (no space).</p>

  p    {gap-size: 1.4ch;} /* or ‘sentence-spacing’ */
  abbr {gap-size: 0.6ch;}

What about the horizontal tabulator, however?

 <p>I’m a sentence.	Me too!</p>

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

Maybe a new value for the ‘white-space’ property would be preferable, 
‘pre-space’ would have a row entry of “Collapse 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