Scripsit fidokomik:
Yes I'm using <nobr>...</nobrbut it is mentioned in HTML 4.01 as
invalid (not exists) tag ;-)
It's not mentioned in HTML 4.01 at all. It's still a better supported
method than any of the alternatives.
>The interesting question is: under which circumstances would a
browser (which?) break a string like 20.01.2008?
Maybe in IE 5x or not updated IE6.0.
I'm not saying that it's impossible, but I'm pretty sure I would have
observed it if it actually had occurred. I suppose you have observed
some similar effect and expect that IE could break after periods as
well.
Turning now to page 273 in my book "Unicode Explained", we learn that
the period (formally in Unicode: FULL STOP) belongs to line breaking
class IS, infix separator, which means (flip to p. 278 for a quick
summary) that no break is allowed between a digit and a period (even if
spaces intervene) or between a period and a digit (unless a space
intervenes). IE does not follow the Unicode line breaking rules except
partially, but usually when it does odd things in line breaking, it does
so because of its partial attempts at following those rules. Hence it
would be rather unexpected if it broke a string like 20.01.2008.
Maybe my example is
wrong but a well example (bad wrapping) is "Temperature is 10 deg.C in
country".
That's a different issue and involves line breaking issues of two kinds.
In some cases it is wrapped as
Temperature is 10
deg.C in country.
but should be
Temperature is
10 deg.C in
country.
The rules for expressing quantities say that a line break between a
number and a unit symbol is not permitted. General line breaking rules
and formatting algorithms cannot deal with such cases, since they
operate at lower "protocol levels". An author needs to take care of the
problem, and in this special case, you could use the no-break space,
writing it as such or as entity reference , which works fine, so
you would not need the <nobrmarkup.
However, there's a different issue with the unit symbol. The notation
"deg.C" does not comply with standards. The standard symbol for degrees
Celsius is °C, and if you don't have a handy keyboard setting where you
can type the degree sign ° conveniently, you can use the entity
reference °.
So far so good: you could write
10 °C
and this would mostly work fine. However, by the Unicode rules, the
degree sign is in line breaking class PO, postfix (numeric), which means
that there is a direct break opportunity (i.e., line break is allowed
even if no spaces intervene) between it and e.g. an alphabetic character
after it. So when a suitable - or, rather, unsuitable - situation
arises, the expression might get broken as
10 °
C
which is really bad, and that's why I recommend
<nobr>10 °C</nobr>
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/