473,545 Members | 2,715 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 7978
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
31377
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...
4
4539
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
2308
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 ...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7943
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...
1
7456
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
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...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1919
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
0
743
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...

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.