W3C home > Mailing lists > Public > public-html@w3.org > December 2012

Re: The missing Sentence tag

From: Thomas A. Fine <fine@head.cfa.harvard.edu>
Date: Sat, 08 Dec 2012 02:45:39 -0500
Message-ID: <50C2F023.3060806@head.cfa.harvard.edu>
To: Charles McCathie Nevile <chaals@yandex-team.ru>
CC: public-html@w3.org
On 12/6/12 9:20 PM, Charles McCathie Nevile wrote:
> On Wed, 05 Dec 2012 18:57:28 +0100, Thomas A. Fine
>> If HTML has been given all the modern tools of convenience that we now
>> have, shouldn't it also include one of the most basic tools that
>> typesetters have been using for centuries?
>
> Not necessarily. It doesn't have tabs, either.

Typesetters didn't have tabs, per se.  They had all the arbitrary 
spacing they needed.  And they had "furniture" for more complex layouts. 
HTML has everything you need to do tabs, whether that's tables, or 
paragraph indenting, or divs and the box model, or various other CSS 
tools.  It turns out that adding spaces between sentences is more 
problematic, at least in my opinion.

> I am somewhat sceptical because I am not sure how important to people this
> really is. You can already use the span element for any inline run of
> text, so <span class="sentence"> is obviously a legitimate way to manage
> this. Equally obviously, that won't be produced by hand very often.

I've done this for demonstration purposes, there's an example here: 
http://hea-www.harvard.edu/~fine/Tech/html-sentences.html

Which brings me to what I perceive is the other problem that's related 
to not having a sentence tag: there is no CSS that is really good at 
altering the spacing of inline elements.  The obvious answer of just 
using the box model doesn't work properly because it doesn't interact 
properly with line-wrapping (i.e. the box space doesn't act like a space 
character).

The method I settled on, word-spacing, is in my opinion a poor approach 
because you have to set things the opposite from the way you want them 
hierarchically.  You have to set paragraph word-spacing to 
sentence-sized spaces, and then override this setting inside the 
sentences to set word-spacing back to word-sized.  Yes, that functions 
properly, but it's just a bad model.

Ideally you'd want some CSS that would let you control the 
"word-spacing" adjacent to or between the tags that you are configuring, 
instead of within them.  In the simplest implementation I can think of, 
you'd have a sentence tag, and then you'd have a sentence-spacing 
property, and that would apply wherever two sentence elements butted up 
against each other within an inline flow.  This would act the way things 
are supposed to in CSS - you could set your word and sentence spacing 
globally, or override them in different divs or paragraphs as desired.

A more complex approach might be to give every inline element a generic 
way to modify its inline spacing.  Elements would be able to request 
additional (or less) space before/after/both, and rules like 
largest-one-wins or highest-priority would determine how to modify the 
space between elements.  This approach would give more control.  It 
wouldn't need a specific sentence tag.  But in practice it seems like it 
would be more of a pain to use.

There is one other alternative, which I shudder to even mention.  You 
can put tags around the spaces between sentences, and use CSS to control 
those.  In some sense, this is the exactly what you are trying to do. 
But, spaces aren't really content in HTML, so a tag who's only content 
is always just a single space would be kind of gross.  This is where, as 
someone else suggested, an entity or Unicode character for an 
unambiguous full-stop could be useful.

> Software tools don't commonly seem to do this, or it would have been done
> more already. In practice, you should probably demonstrate the need by
> getting authoring tools to produce marked-up sentences, and showing that
> there is uptake - i.e. that styling sentences is really something people
> consider important.

At this point, if I built such a tool on top of the lack of a sentence 
tag and the lack of a good structured CSS to control the tags, people 
who look at the results will likely conclude (rightly) that what my tool 
creates a great big mess.  But yeah, maybe a tool for blogger or 
wordpress or something.  The web page above is a start, in that it 
demonstrates the dynamic control of sentence spacing that's possible.

> On the other hand, that also means the fact something wasn't implemented
> ages ago is not very good evidence for the lack of a use case.

The majority of awesome things in the world would never exist if this 
were the case.

        tom
Received on Saturday, 8 December 2012 07:46:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:36 UTC