From: removeps-groups on
How to wrap text in <p> tag if the text has no spaces and is very
long? Here is an example:

<p>VeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLongVeryVeryLong</
p>

The above line is so long that it ought to wrap. But because it has
no spaces, it does not wrap. Instead the entire text is really on one
line. In Dreamweaver they show you the text going on and on to the
right, about 3 screen lengths. But in Firefox, the text past the div
boundary (ie. to the right of the boundry) does not show up.

Strangely, this google editor they also only do text wrapping if the
text has spaces in it. But if no spaces, then you have to scroll to
the right to see all of the <p> tag.

BTW, I also tried putting the text into <blockquote>.
From: removeps-groups on
On Apr 4, 10:50 am, Jim Moe <jmm-list.AXSPA...(a)sohnen-moe.com> wrote:
> On 03/29/08 03:45 pm,removeps-gro...(a)yahoo.com wrote:> How to wrap text in <p> tag if the text has no spaces and is very

> > The above line is so long that it ought to wrap. But because it has
> > no spaces, it does not wrap. [...]
>
> Why would it wrap? There are no spaces. Who cares what an editor does?
> Perhaps if you gave some context for such a ridiculously long line, we
> could offer a sensible solution.

I'm writing a 404 error page in JSP that says we could not find the
URL you entered. It writes out the URL, and unfortunately the URL is
longer than the screenwidth and is clipped off.
From: Jukka K. Korpela on
Scripsit removeps-groups(a)yahoo.com:

> I'm writing a 404 error page in JSP that says we could not find the
> URL you entered. It writes out the URL, and unfortunately the URL is
> longer than the screenwidth and is clipped off.

Well, why didn't you tell that in your first posting, and why do you
_still_ fail to try to find the right group? CSS has nothing to offer
you but overflow handling.

And why would the URL matter? It's available in the address bar anyway.
If you really wish to display it, study the URL specs for "URI in
context" and some Style Guide for rules on admissible breaks in URLs "in
context", and implement the strategy server-side (assing <wbr> at
suitable places and doing something the _prevent_ line breaks after
hyphens).

There's not very much useful one can say on a 404 error page (most 404
pages concentrate on saying something cryptic if not outright false),
but how will the URL benefit the user?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

From: removeps-groups on
On Apr 6, 6:27 am, "Jukka K. Korpela" <jkorp...(a)cs.tut.fi> wrote:

> Well, why didn't you tell that in your first posting, and why do you
> _still_ fail to try to find the right group? CSS has nothing to offer
> you but overflow handling.

Sorry, maybe I should have said this in the first post. However, the
problem (of having enormously long words) could occur in other
contexts. Many editors like VI and MSWord do wrap words longer than
one line, so I thought CSS might have a property you can set on a div
to enable this. Maybe they should add a a property "wrapAt" whose
default value is "space" but can be "all". Right now it's as if there
is a <wbr> after every space, so with "all" there would be a <wbr>
after every character.

But you give me an idea -- maybe I can use "overflow:scroll".


> And why would the URL matter? It's available in the address bar anyway.

No, the address bar will show "http://www.mywebsite.com/errors/
404.jsp", whereas I want to echo what the user typed. This is just to
show them what they typed so that they can see the typo and fix it.
Seems more user friendly to me.


> If you really wish to display it, study the URL specs for "URI in
> context" and some Style Guide for rules on admissible breaks in URLs "in
> context", and implement the strategy server-side (assing <wbr> at
> suitable places and doing something the _prevent_ line breaks after
> hyphens).

Thanks, I'll look into this.
From: Jukka K. Korpela on
Scripsit removeps-groups(a)yahoo.com:

> On Apr 6, 6:27 am, "Jukka K. Korpela" <jkorp...(a)cs.tut.fi> wrote:
>
>> Well, why didn't you tell that in your first posting, and why do you
>> _still_ fail to try to find the right group? CSS has nothing to offer
>> you but overflow handling.
>
> Sorry, maybe I should have said this in the first post.

There's really no "maybe" in either of my statements.

> However, the
> problem (of having enormously long words) could occur in other
> contexts.

Who cares? Different situations call for different solutions.

> Many editors like VI and MSWord do wrap words longer than
> one line,

Maybe. That has little if anything to do with CSS.

> so I thought CSS might have a property you can set on a div
> to enable this. Maybe they should add a a property "wrapAt" whose
> default value is "space" but can be "all".

"Maybe" the situation is far more complicated.

IE recognizes a nonstandard CSS property that effectively allows any
breaks. It's not useful, because you seldom want to make all breaks
allowed and because other browsers won't recognize the property.

> Right now it's as if there
> is a <wbr> after every space,

No, it's more complicated. But why do you care? URLs are not allowed to
contain whitespace.

> But you give me an idea -- maybe I can use "overflow:scroll".

"Maybe" it's a _bad_ idea. I mentioned the CSS feature to emphasize how
far from your problem CSS currently is.

>> And why would the URL matter? It's available in the address bar
>> anyway.
>
> No, the address bar will show "http://www.mywebsite.com/errors/
> 404.jsp",

That's absurd, even if you really own the mywebsite.com domain (which
actually exists).

The address bar should show the URL requested by the client. Don't mess
around with it. It's absurd to break something and then try to construct
a plastic imitation, running into endless trouble.

To be honest, my 404 error page echoes the URL, and I don't really care
if it does not fit into the available width. The user may have to
scroll, but why would I set up some _separate_ scrolling mechanism with
overflow: scroll (or overflow: auto, which makes much more sense)?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/