Click here to get back home

Firefox doesn't break lines at hyphens

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Firefox doesn't break lines at hyphens Gustaf Liljegren 08-30-2004
Posted by Gustaf Liljegren on August 30, 2004, 9:17 am
Please log in for more thread options
IE does, and I can't remember this used to be a problem in Netscape. I
guess someone in the Mozilla team just came up with a Smart Idea about
the True Semantics of the Hyphen Minus character. :-( How do I make IE
and Firefox agree to make hyphens trigger a linebreak?

Gustaf


Posted by Jan Roland Eriksson on August 30, 2004, 9:57 am
Please log in for more thread options
On Mon, 30 Aug 2004 08:17:28 +0200, Gustaf Liljegren

>IE does, and I can't remember this used to be a problem in Netscape. I
>guess someone in the Mozilla team just came up with a Smart Idea about
>the True Semantics of the Hyphen Minus character. :-( How do I make IE
>and Firefox agree to make hyphens trigger a linebreak?

Why would you want to do that?

Also please know that this subject has been discussed before of course.
You may want to use, as one possible search starting point, definition
and references to discussions on the entity ­ to find out what has
been said so far.

http://groups.google.com/groups?q=%26shy%3B&meta=group%3Dcomp.infosystems.www.authoring.html

Mind you that there is more to this than what meets the eye initially.

--
Rex




Posted by Philipp Lenssen on August 30, 2004, 10:08 am
Please log in for more thread options
Jan Roland Eriksson wrote:

> On Mon, 30 Aug 2004 08:17:28 +0200, Gustaf Liljegren
>
> > IE does, and I can't remember this used to be a problem in
> > Netscape. I guess someone in the Mozilla team just came up with a
> > Smart Idea about the True Semantics of the Hyphen Minus character.
> > :-( How do I make IE and Firefox agree to make hyphens trigger a
> > linebreak?
>
> Why would you want to do that?
>

To jump in the conversation, a line-break after a hyphen is normal
usage in books, newspapers etc. So the question would be why would one
*not* want that?

I ran into the same problem recently. I was using pixel-values for
table-cells and Firefox did not dare to break state names such as
"Baden-Wurtemberg", even though Internet Explorer did. Firefox just
ignored the table-cell widths as defined in the CSS and made the table
move out of the layout frame as suggested by our designers. (Now I
suppose someone will tell me I can't have pixel-perfect layout on the
Web and should rather go for PDF... great. Because line-breaks *do*
usually work, and HTML is well for this.)

By the way, playing around with putting span trickery etc. here and
there didn't solve the problem. I finally had to insert hard breaks
("<br />") via the ASP that served the pages.

--
Google Blogoscoped
http://blog.outer-court.com


Posted by Gustaf Liljegren on August 30, 2004, 1:32 pm
Please log in for more thread options
Jan Roland Eriksson wrote:

>>How do I make IE and Firefox agree to make hyphens trigger a
>>linebreak?

> Why would you want to do that?

My text has a lot of hyphens in it. In fact,
every-space-character-is-replaced-with-a-hyphen, (to illustrate a steady
drone-like phonation without pauses). I don't want the invisible soft
hyphens here, and I don't want the non-breaking hyphen. I want visible
hyphens that may trigger a linebreak, if needed.

I found Jukkas page on hyphens [1] and it says: "A minus sign may not be
separated from following numeric characters or following opening
characters, even if a space character intervenes."

If "following opening characters" means normal letters, then Firefox
does the right thing, but then there seem to be no way to achieve this
effect. Before today, I was under the impression that hyphens are used
to say "this word continues on the next line". Now it seems Unicode
needs a "breaking hyphen" character.

Gustaf

[1]http://www.cs.tut.fi/~jkorpela/dashes.html


Posted by Jukka K. Korpela on August 30, 2004, 12:56 pm
Please log in for more thread options

> My text has a lot of hyphens in it. In fact,
> every-space-character-is-replaced-with-a-hyphen, (to illustrate a
> steady drone-like phonation without pauses).

I will assume that the hyphen (or, technically, the hyphen-minus
character, or "Ascii hyphen", as opposite to real Unicode hyphen)
is the appropriate character here. I don't know the conventions used in
such presentations, and I can't tell how they are best described in terms
of abstract characters.

> I don't want the invisible soft
> hyphens here, and I don't want the non-breaking hyphen. I want
> visible hyphens that may trigger a linebreak, if needed.

Then the way that works most often without causing damage when it doesn't
is the use of nonstandard <wbr> markup:
foo-<wbr>bar
The theoretically more correct
foo-&#8203;bar
fails badly (&#8203; rendered as a small rectangle) in most browsing
situations, I'm afraid. More on this:
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest
(Both methods work on Firefox.)

By Unicode line breaking rules, the hyphen is automatically breakable, in
the sense that line break after it is allowed. HTML 2.0 (!) mentioned the
possibility that browsers break a line after a hyphen, and IE actually
implemented this. On the other hand, this is regarded as a very bad idea
by many, because there is a huge number of cases where such breaks are
not desirable.

> I found Jukkas page on hyphens [1] and it says: "A minus sign may not
> be separated from following numeric characters or following opening
> characters, even if a space character intervenes."

Yes, but it's about the minus sign, the Unicode character for use as a
mathematical minus symbol specifically.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Similar ThreadsPosted
Allowing lines to break at hyphens? November 15, 2004, 3:23 pm
Blank lines and paragraph break in html May 10, 2007, 10:31 pm
Table without lines June 12, 2008, 12:15 pm
how can I validate with these lines of HTML? May 14, 2005, 7:13 pm
Two lines of text in inline context September 1, 2005, 5:40 am
White space, new lines in tags March 25, 2006, 1:52 am
Lenth of lines in html source? July 7, 2008, 9:33 pm
non-breaking hyphens?? October 8, 2004, 12:59 pm
without

break

November 7, 2004, 8:44 pm
page-break March 3, 2005, 1:33 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap