473,503 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Breaking hyphen in Mozilla and an IE display problem

1) I want to show a breaking hyphen in Mozilla 1.5.0.4

How do I do that?

"Unicode standard annex #14", <http://www.unicode.org/reports/tr14/>,
defines 4 breaking hyphens.

<quote>
Breaking hyphens establish explicit break opportunities
immediately after each occurrence.

058A ARMENIAN HYPHEN
2010 HYPHEN
2012 FIGURE DASH
2013 EN DASH
</uote>

Mozilla won't display the first of these but I don't mind that. I have
tried the other 3 but my document doesn't break. What am I doing wrong?
I am currently using 2013.

Here is the document. Excuse the adverts.
<http://www.ourrights.0catch.com/Toxicity.Comparison_Addiction.99,p686.(2004)-3.htm#table1>

In other words, I want Mozilla to break the line in the same place that
IE does.

2) With IE 6.0.2900, the table column's 9 and 10 are not always
separated with a gray line (on lines 8 and 12). What is wrong here?

Jun 5 '06 #1
4 4535
Rubin wrote:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4

How do I do that?


Mozilla apparently doesn't support 'soft' hyphens. See (e.g.) here:
http://forums.mozillazine.org/viewto...0a3d1e4699c195

The specs for HTML 4.0 and HTML 4.01 are vague on whether this omission
is properly described as a bug; they describe what browsers that support
the soft hyphen *must* do, but they don't say that they *must* support it.

It seems that a 2007 release of Gecko may fix the problem, which has
been outstanding since [gasp!] 1999.

--
Jack.
Jun 5 '06 #2
On Mon, 5 Jun 2006, Rubin wrote:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4
As I understand it, you want Moz. (and presumably other browsers too)
to take advantage of a break opportunity after the hyphen.

You don't want the semantics of the soft-hyphen ­ (which is poorly
supported, even if you /did/ want it...) - right?
How do I do that?
Sadly, the answer isn't a simple one.
<quote>
Breaking hyphens establish explicit break opportunities
immediately after each occurrence.

058A ARMENIAN HYPHEN
2010 HYPHEN
2012 FIGURE DASH
2013 EN DASH
</uote>

Mozilla won't display the first of these but I don't mind that. I
have tried the other 3 but my document doesn't break. What am I
doing wrong?


I don't think you're doing anything wrong. Mozilla isn't supporting
this.

In theory, you could resolve the problem by placing a zero-width space
U+200B (​ if you want a decimal character reference) anywhere
you want to offer a break opportunity. Indeed this works with Moz,
and does no harm with (e.g) Opera or MSIE (provided you're not using
a monospaced font!).

Unfortunately, some browser/versions don't understand what that is,
and will display an ugly glyph (their missing-character indicator) in
its place.

A practical way out may be to use the proprietary <wbr> markup. It'll
cause the document to fail validation against W3C DTDs, of course; but
those browsers that don't explicitly understand it will apply standard
HTML error recovery from unknown tags, producing the desired result.
Only you (or whoever sets the specifications for what you do) can
decide whether this workaround is permissible; but in practical terms
I've never heard of it not giving its impression of working.

h t h
Jun 5 '06 #3
On Mon, 5 Jun 2006 20:11:54 +0100, "Alan J. Flavell"
<fl*****@physics.gla.ac.uk> wrote:
On Mon, 5 Jun 2006, Rubin wrote:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4


As I understand it, you want Moz. (and presumably other browsers too)
to take advantage of a break opportunity after the hyphen.

You don't want the semantics of the soft-hyphen ­ (which is poorly
supported, even if you /did/ want it...) - right?
How do I do that?


Sadly, the answer isn't a simple one.
<quote>
Breaking hyphens establish explicit break opportunities
immediately after each occurrence.

058A ARMENIAN HYPHEN
2010 HYPHEN
2012 FIGURE DASH
2013 EN DASH
</uote>

Mozilla won't display the first of these but I don't mind that. I
have tried the other 3 but my document doesn't break. What am I
doing wrong?


I don't think you're doing anything wrong. Mozilla isn't supporting
this.

In theory, you could resolve the problem by placing a zero-width space
U+200B (​ if you want a decimal character reference) anywhere
you want to offer a break opportunity. Indeed this works with Moz,
and does no harm with (e.g) Opera or MSIE (provided you're not using
a monospaced font!).

Unfortunately, some browser/versions don't understand what that is,
and will display an ugly glyph (their missing-character indicator) in
its place.

A practical way out may be to use the proprietary <wbr> markup. It'll
cause the document to fail validation against W3C DTDs, of course; but
those browsers that don't explicitly understand it will apply standard
HTML error recovery from unknown tags, producing the desired result.
Only you (or whoever sets the specifications for what you do) can
decide whether this workaround is permissible; but in practical terms
I've never heard of it not giving its impression of working.


Thanks,

I replaced my hyphens with -<wbr>

Jun 5 '06 #4
Alan J. Flavell <fl*****@physics.gla.ac.uk> scripsit:
As I understand it, you want Moz. (and presumably other browsers too)
to take advantage of a break opportunity after the hyphen.
According to the Unicode standard, both the good old Ascii hyphen (Unicode
name: hyphen-minus) and the Unicode hyphen allow a line break after them,
with some limitations. In this sense, you could simply use "-" or ߚ.
However, in addition to lack of universal browser support to this idea, such
support is not _required_ in published specifications.

HTML specifications do not require that browsers conform to the Unicode
standard. The specs use Unicode (or, more exactly, ISO 10636) to define the
document character set, but this does not include a conformance requirement.
(Moreover, conformance requirements do not say that all the defined
semantics of characters be obeyed.)

There is no explicit statement in HTML specs about a break opportunity after
a hyphen. HTML 2.0 referred to such a thing as an _allowed_ behavior. HTML
4.01 says that the "plain hyphen" (i.e., Ascii hyphen) is "should be
interpreted by a user agent as just another character". This might even be
read as saying that it be treated as a graphic character with no line
breaking opportunities, but this is hardly the intention. Rather, the issue
is left open.
( http://www.w3.org/TR/REC-html40/stru...ml#hyphenation )
A practical way out may be to use the proprietary <wbr> markup.


Indeed. But there's the opposite problem, too. Internet Explorer and some
other browsers treat the Ascii hyphen as _always_ allowing a line break
after it, even in a context like -1 (which looks rather bad with the lone
"-" at the end of a line and "1" at the start of the next line). In the
special case where an Ascii hyphen is really meant to act as a minus sign,
there's thus a good reason to use the minus sign instead, e.g. writing
&minus;1 (which is rather well supported, won't be broken into two lines,
looks typographically better, and makes things clearer).

In a more general case, to prevent an undesired line break in, say, -a,
there are several options, but the practical approaches are the nonstandard
markup
<nobr>-a</nobr>
and the use of CSS, e.g. using markup
<span class="nobr">-a</span>
with CSS code
..nobr { white-space: nowrap; }

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jun 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

76
15038
by: Zenobia | last post by:
How do I display character 151 (long hyphen) in XHTML (utf-8) ? Is there another character that will substitute? The W3C validation parser, http://validator.w3.org, tells me that this character...
20
3507
by: RobG | last post by:
I'm messing with getPropertyValue (Mozilla et al) and currentStyle (IE) and have a general function (slightly modified from one originally posted by Steve van Dongen) for getting style properties:...
87
6331
by: Frances Del Rio | last post by:
is there a non-breaking hyphen in HTML?? for example, so a phone no. falls all on one line.. as in.. 1-800-444-5454... (and is not broken into two lines if phone no. occurs near end of a...
27
31362
by: The Bicycling Guitarist | last post by:
Hi. I found the following when trying to learn if there is such a thing as a non-breaking hyphen. Apparently Unicode has a ‑ but that is not well-supported, especially in older browsers. Somebody...
22
7975
by: stevenkobes | last post by:
If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a...
0
2306
by: Andreas Prilop | last post by:
It seems to me that Internet Explorer 7 (as opposed to IE6) displays the non-breaking-hyphen U+2011 or ‑ as some sort of dash rather than a hyphen. See U+2011 #8209 at...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.