473,727 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

breaking hyphen?

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 way to
denote a hyphen in HTML, that the line can be broken after?

I've read some stuff about soft hyphens and non-breaking hyphens, but
those seem like the opposite of what I'm looking for. I want a normal
hyphen, that always appears, and I want the line to be breakable after
it in Firefox as well as IE.

Does anyone know if this is possible?

Oct 24 '05 #1
22 8005
st*********@hot mail.com wrote:
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,
So is the IE behavior. The specifications are obscurely silent on the
matter. Technically, HTML 4.01 specification says that "the plain hyphen
should be interpreted by a user agent as just another character",
http://www.w3.org/TR/REC-html40/stru...t.html#h-9.3.3
but I don't think this is meant to disallow breaking after a hyphen as
was suggested in HTML 2.0 and as the Unicode standard defines.
Is there a way to
denote a hyphen in HTML, that the line can be broken after?


Using <wbr> after a hyphen is the practical way, e.g. as in
non-<wbr>breaking
The long answer is at
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest
Oct 24 '05 #2
"Jukka K. Korpela" wrote:

st*********@hot mail.com wrote:
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,


So is the IE behavior. The specifications are obscurely silent on the
matter. Technically, HTML 4.01 specification says that "the plain hyphen
should be interpreted by a user agent as just another character",
http://www.w3.org/TR/REC-html40/stru...t.html#h-9.3.3
but I don't think this is meant to disallow breaking after a hyphen as
was suggested in HTML 2.0 and as the Unicode standard defines.
> Is there a way to
denote a hyphen in HTML, that the line can be broken after?


Using <wbr> after a hyphen is the practical way, e.g. as in
non-<wbr>breaking
The long answer is at
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest


<wbr> is non-standard and not recognized by all browsers. It does
not exist in the HTML 4.01 specification.

Breaking and wrapping styles are indicated for CSS3. However, the
specification is still in flux with comments on the draft for the
affected text module being accepted until some time next year. I
don't know of any browsers that implement the proposed draft of the
CSS3 text module.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
Oct 24 '05 #3
David Ross <no****@nowhere .not> writes:
"Jukka K. Korpela" wrote:
Let's add some emphasis here
Using <wbr> after a hyphen is the practical way, e.g. as in ^^^^^^^^^ non-<wbr>breaking
The long answer is at
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest


<wbr> is non-standard


What-*standard*?

IIRC, just recently the use of the width and height attribute for the
IMG element type were suggested here for practical reasons. They are
non-*standard* as well and nobody appeared to complain, as far as I can
recollect.
and not recognized by all browsers.
It's recognized by most browsers that care about such details in the
first place, I dare saying. OTOH, lots of recommended or even
standardized element-types are either not recognized as well or --
worse, actually -- not processed properly (e.g. NOSCRIPT).
It does
not exist in the HTML 4.01 specification.


If it helps, the HTML 4.01 recommendation itself is non-standard.

Oct 25 '05 #4
Eric B. Bednarz <be*****@fahr-zur-hoelle.org> writes:
OTOH, lots of recommended or even
standardized element-types are either not recognized as well or --
worse, actually -- not processed properly (e.g. NOSCRIPT).


My bad, SCRIPT and consequently NOSCRIPT are not part of ISO/IEC
15445:2000 either; make that e.g. 'e.g. Q' then.

Oct 25 '05 #5

st*********@hot mail.com wrote:
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 way to
denote a hyphen in HTML, that the line can be broken after?


This is a known bug in the Mozilla family:

<https://bugzilla.mozill a.org/show_bug.cgi?id =95067>

I reported it ages ago, and it was worked on for a while, but fixing it
is not currently assigned to anyone.

I don't understand why it is not being fixed. I reported the same
problem in Opera and Safari, and it was fixed quite quickly.

--
Alan Wood
http://www.alanwood.net (Unicode, special characters, pesticide names)

Oct 25 '05 #6
Alan Wood wrote:
I don't understand why it is not being fixed. I reported the same
problem in Opera and Safari, and it was fixed quite quickly.


I don't think it was an improvement that Opera started dividing "-1"
into "-" at the end of a line and "1" at the start of the next line.

(Or consider the string "Latin-1". Do you really want "1" to go to the
next line?)

Granted, we can list down a dozen ways to prevent that. The problem is
that the average author knows none of them, does not even know the
problem exists except casually, and besides, all the dozen or more ways
have serious drawbacks. It's frustrating to decide between poor ways of
solving a problem that didn't exist before some software started to
break lines blindly by some rules.

A browser should _not_ break a string after a hyphen-minus character or
other special character _unless_ it applies reasonable constraints and a
working way to prevent the breaks is available. Nonbreaking hyphen won't
count, for several years. Unfortunately, the leading browser decided to
to break lines without reasonable constraints, so the more reasonable
behavior of Mozilla does not help authors. We need to learn the morale:

A word might be broken after a hyphen, or not be broken.

If this really matters, you probably have some boring work ahead. You
need to scatter extra markup around, perhaps quite a lot.

Yucca
Oct 25 '05 #7

Jukka K. Korpela wrote:
I don't think it was an improvement that Opera started dividing "-1"
into "-" at the end of a line and "1" at the start of the next line.

(Or consider the string "Latin-1". Do you really want "1" to go to the
next line?)


I agree that a simple "allow break after a hyphen" rule is not an ideal
solution.

One possible improvement would be to add a condition that a break
should not be allowed if it would leave a string of 3 or fewer
characters at tne end or start of a line. Another possible improvement
would be not to allow a break between a hyphen and a number, so that
negative numbers are not broken.

Opera is working on a new rendering engine for version 9, and a preview
is available:
- Windows: <http://snapshot.opera. com/windows/w90p1.html>
- UNIX: <http://snapshot.opera. com/unix/u90p1.html>
- Mac: <http://snapshot.opera. com/mac/m90p1.html>

This would be a good time to test its breaking algorithm and provide
feedback. Opera do take notice of feedback.

--
Alan Wood
http://www.alanwood.net (Unicode, special characters, pesticide names)

Oct 26 '05 #8
On Mon, 24 Oct 2005, Jukka K. Korpela wrote:
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,
So is the IE behavior. The specifications are obscurely silent on the
matter.


http://www.unicode.org/reports/tr14/ is "obscurely silent"?
Technically, HTML 4.01 specification says [...]


The document character set is Unicode. Therefore it is not necessary
to repeat in the HTML specification what is already said in the
Unicode standard.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lan g>

Oct 26 '05 #9
On Tue, 25 Oct 2005, Jukka K. Korpela wrote:
(Or consider the string "Latin-1". Do you really want "1" to go to the
next line?)
We have the non-breaking hyphen for this purpose.
The problem is
that the average author knows none of them, does not even know the
problem exists except casually,


The "average author" can't tell an acute accent (´) from
an apostrophe (').
http://www.helsinki.fi/images/harmaa_ranska.gif

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lan g>

Oct 26 '05 #10

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

Similar topics

27
31416
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 somewhere said: Alternately, you can use CSS to declare a class having: ..nowrap { white-space:nowrap } .... and then wrap the compound word in a <span class=nowrap></span> tag (or any other suitable inline tag). You can also try {...
4
4557
by: Rubin | last post by:
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.
0
2314
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 http://www.alanflavell.org.uk/unicode/unidata20.html#x2010 http://niwo.mnsys.org/saved/~flavell/unicode/unidata20.html http://www.cs.tut.fi/~jkorpela/dashes.html#unidash My test page is
0
8891
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9406
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6703
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4521
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4786
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.