473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Allowing lines to break at hyphens?

I've read the recent post about not breaking at hyphens in HTML documents.
I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign')

IE6 and Opera7.54 both break phrases such as "never-to-be-forgotten" exactly
as I want but Mozilla1.7.3 and Firefox1.0 don't. The same happens with
entitites such as –
The CSS white-space: property doesn't seem to correct things.

The zero-width space entity ​ after each minus sign fixes things for
all the mentioned browsers except for IE6, which renders it as a small
square box. Does IE6 support this character entity?

The only solution I could find was to insert the following
<span style="font-size:0px"> </span>
after each hyphen. It works but it's a clumsy hack.

The easiest and neatest solution is not to hyphenate the phrase at all.
Jul 23 '05 #1
8 2653
On Mon, 15 Nov 2004, Danny@Kendal wrote:
I *want* breaking to occur at hyphens. (for 'hyphen' read 'minus sign')
Err, what?

I *want* Bush. (For 'Bush' read 'Kerry'.)

Usually, I do not want breaking after a minus sign, e.g. -273*°C.
The zero-width space entity &#x200B; after each minus sign fixes things for
all the mentioned browsers except for IE6, which renders it as a small
square box. Does IE6 support this character entity?


U+200B ​ is outside the WGL4 character set.
http://ppewww.ph.gla.ac.uk/~flavell/...unidata20.html
This means Internet Explorer in its _default_ setup is likely to fail
at this character.

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 23 '05 #2
"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote:
I've read the recent post about not breaking at hyphens in HTML
documents. I *want* breaking to occur at hyphens. (for 'hyphen' read
'minus sign')
As Andreas wrote, it's illogical to say "hyphen" and mean "minus sign".
Using the Ascii hyphen-minus as a surrogate for the minus sign is
understandable (though typographically, the en dash or the em dash is a
better surrogate), but it does not _make_ it a minus sign.
IE6 and Opera7.54 both break phrases such as "never-to-be-forgotten"
exactly as I want but Mozilla1.7.3 and Firefox1.0 don't.
So do you mean hyphens, or do you mean minus signs?
The same
happens with entitites such as &ndash;
Which is neither a hyphen nor a minus sign, but could be used as a
surrogate for the latter.
The CSS white-space: property doesn't seem to correct things.
It can be used to prevent line breaks in such cases, but not explicitly
allow them.
The zero-width space entity &#x200B; after each minus sign fixes
things for all the mentioned browsers except for IE6, which renders
it as a small square box.
Which rules this approach out for most purposes in authoring for the WWW,
does it not.
Does IE6 support this character entity?
It's not an entity but a character reference. IE recognizes it but fails
to apply any specific semantics to it or even render it properly.
The only solution I could find was to insert the following
<span style="font-size:0px"> </span>
after each hyphen. It works but it's a clumsy hack.
It may work for some values of "work". How about a browser that has been
configured to use a minimum font size, for example?
The easiest and neatest solution is not to hyphenate the phrase at
all.


It's not neat at all if the correct spelling contains hyphens.

The practical method is to use the tag <wbr> after the hyphen, or dash,
or minus sign. The <wbr> tag was invented by Netscape, then adopted by
other browser vendors as well, later dropped out in Netscape, then
re-introduced. But in any case, it either does nothing, or it allows a
line break, so it's a safe hack.

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

Jul 23 '05 #3
"Andreas Prilop" <nh******@rrzn-user.uni-hannover.de> a écrit dans le
message de news:Pine.GSO.4.44.0411151534410.7398-100000@s5b004
U+200B ​ is outside the WGL4 character set.


What is the "WGL4 character set" ?

Jul 23 '05 #4
On Tue, 16 Nov 2004, Pierre Goiffon wrote:
What is the "WGL4 character set" ?


What's a search engine?

http://www.google.com/search?q=wgl4

Microsoft has now defined a character set standard which includes
characters required by Western, Central, and Eastern European writing
systems, as well as characters required by Greek and Turkish. This
"PanEuropean" character set contains 652 characters and is called
WGL4: Windows Glyph List 4.

Of course, like all vendor-defined "standards", it can change at the
vendor's whim: the original WGL4 definition is subtly different from
the current "WGL4.0" definition. Who'd have thought that .0 was
greater than nothing?
Jul 23 '05 #5
In article <41**********************@news.free.fr>,
Pierre Goiffon <pg******@nowhere.invalid> wrote:
"Andreas Prilop" <nh******@rrzn-user.uni-hannover.de> a écrit dans le
message de news:Pine.GSO.4.44.0411151534410.7398-100000@s5b004
U+200B ​ is outside the WGL4 character set.


What is the "WGL4 character set" ?


It stands for "Windows Glyph List 4" and it is a Microsoft-defined
subset of Unicode that "includes characters required by Western,
Central, and Eastern European writing systems, as well as characters
required by Greek and Turkish." More info at
http://www.microsoft.com/typography/unicode/cscp.htm .

--
= Eric Bustad, Norwegian bachelor programmer
Jul 23 '05 #6
On Mon, 15 Nov 2004 17:48:26 +0000, "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote in message
<Xn*****************************@193.229.0.31>:
"Danny@Kendal" <da***@STOPSPAMghpkendal.co.uk> wrote:
I've read the recent post about not breaking at hyphens in HTML
documents. I *want* breaking to occur at hyphens. (for 'hyphen' read
'minus sign')


As Andreas wrote, it's illogical to say "hyphen" and mean "minus sign".


Maybe I should have said I use the character - to hyphenate words
rather than some other character such as &hyp; &ndash; or &mdash;

Anyway. It turns out that this is a problem with Mozilla and Mozilla-based
browsers which has been known about for centuries, or so it would seem.

<wbr> was a useful tip. Thanks.

--
FZS600 - Silver/Black
GS125 - Black/Rust
Ford 100E Prefect - Black, naturally
Whisky - Aberlour Cask Strength
Jul 23 '05 #7
"Eric Kenneth Bustad" <ek*@hos1cad.ho.att.com> a écrit dans le message
de news:cn********@netnews.proxy.lucent.com
What is the "WGL4 character set" ?

(...)

Alan, Eric, thanks very mutch for these details !

Jul 23 '05 #8
Alan J. Flavell wrote:
like all vendor-defined "standards", it can change at the
vendor's whim


Like Monopoly money, as one web page put it: useful as long as the game
is played. [I Googled for the page, but could not find it. Terms like
monopoly, money, and game are a little too common on the www. ;-) ]

--
Brian (remove "invalid" to email me)
Jul 23 '05 #9

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

Similar topics

18
by: Gustaf Liljegren | last post by:
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. :-(...
13
by: Jesse Engle | last post by:
how can i allow a user of my program to enter paragraphs seperated by line spaces using gets() or a similar function? i want the user to be able to enter as many lines as they want, while able...
37
by: Xiao Jianfeng | last post by:
Hi, I need to print a long sting, which is two long so it must expand two lines. I know that we can use backslash(\) to explicitly join two lines into a logical line, but this doesn't work for...
10
by: Tim | last post by:
hi all, I have searched for this, yet with no joy. I have the word e-commerce in an html sentence. The hyphen allows the commerce part to wrap to a new line. Yuck. Is there a no break...
2
by: patrik.nyman | last post by:
I'm doing markup of some original texts, and want to be able too optionally keep the line breaks of the original. But sometimes a word is hyphenated at a line break. At TEI-L I found the...
17
by: kevgibbo | last post by:
Hi, I'm currently having a problem where a long URL or a line of text with no spaces will break the design of a webpage, http:// blog.seoptimise.com/2007/01/how-to-add-delicious-and-digg-blog-...
19
by: Pavan | last post by:
Hi, I want to know if there is any software for measuring lines of code of my c++ application. I found out a tool, sloccount, but it gives only physical lines of code. I found out one more...
9
by: Donos | last post by:
I have a CString with 100 characters. Now i want to make that to 2 lines. For example, CString str = "This is just a test to find out how to break a cstring"; I want this CString in the...
6
by: ARC | last post by:
I know this should be simple, but in a sub-routine that's printing a large batch of reports, how do you code the routine to look for an escape key to allow the user to break out? Thanks! Andy
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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,...

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.