Forum Moderators: open

Message Too Old, No Replies

Very long line not word-wrapping

could it be the backslashes?

         

Purple Martin

3:42 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a very long line being returned by an intranet search engine. The line contains a lot of filepaths, each separated by a space: so it should word-wrap (it's definately a normal space, not a non-breaking one). But it's not word-wrapping, resulting in a very long horizontal scroll and a broken layout.

Here is an example of the kind of stuff in the line:

/foldername/document1.htm /foldername/document2.htm /foldername/document3.htm

I've only included 3 documents there, but imagine it was a couple of dozen or more!

I've copy-n-pasted the line's code into a blank document to prove that the problem is with that line. Could it be the backslash after the space preventing wrapping? Or should I be looking for something else?

Purple Martin

3:44 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've just resized my window to fairly narrow - you can see the problem for yourself with the post above! It doesn't word-wrap!

tedster

4:10 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like this must in the browser's programming. It wraps for me in Opera.

Purple Martin

5:43 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm. I was worried it might be an IE "feature". I've tried adding extra whitespace in the code (extra spaces and returns) and I've tried using the / code for backslash, but nothing seems to fix the problem.

Guardian

1:43 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Browsers have different settings for word-wrap.

All browsers wrap on white-space but some other browsers wrap on other characters too.

Result is that in Opera [I use Opera too] long strings are wraps nicely.

It is mostly OK in IE with some exceptions.

Mozilla and Firebird have the strictest word-wrap and does not force wrap on other characters.
You would end up in very long string which can extend the display and window horizontally. That is one of the reservations regarding FirdBird [Bug Report [bugzilla.mozilla.org]].

Good luck
:)

robert adams

2:18 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



my question is why do you have spaces in a file pathm, it won't work with spaces in it.

robert

Purple Martin

9:53 pm on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



my question is why do you have spaces in a file pathm, it won't work with spaces in it.

It's not one long file path, it's a list of many file paths. See how in the example above there are three file paths, each ending with a file with .htm

robert adams

10:23 pm on Jan 15, 2004 (gmt 0)

10+ Year Member




It's not one long file path, it's a list of many file paths. See how in the example above there are three file paths, each ending with a file with .htm

sorry about that I misread the original post
duh!

robert

WeirdoPL

2:13 am on Jan 16, 2004 (gmt 0)

10+ Year Member



A backslash is this: \
A slash is this: /

In the example You showed there are SLASHES. I'm not making fun of You. I just want to make sure that You explained Your problem.
The example did wrap in Opera (on the last slash) but didn't in IE...

Yes. The slashes are the problem (so the uper part of my post is worth a bucket of sh***). IE seems to treat the space " /" (space + slash) as a string " /" and probably that's why it doesn't wrap it. Opera probably does the same, but has wrapping on slashes (not only on spaces) and that's why the layout isn't broken in Opera.

Solution: instead of " " (space) put "  " (space +   and NOT   + space!) in the source code. Worked in my IE - might work in Yours.

BTW: THAT IS ONE HECK OF A SERIOUS BROWSER BUG WE HAVE!

Purple Martin

1:11 am on Jan 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A backslash is this: \
A slash is this: /
In the example You showed there are SLASHES. I'm not making fun of You. I just want to make sure that You explained Your problem.

OK I'm embarrassed now.

Solution: instead of " " (space) put "  " (space +   and NOT   + space!) in the source code. Worked in my IE - might work in Yours.

Bingo! Thanks dude.

BTW: THAT IS ONE HECK OF A SERIOUS BROWSER BUG WE HAVE!

IT SURE IS!

WeirdoPL

12:20 am on Jan 18, 2004 (gmt 0)

10+ Year Member



Glad to hear it worked! :)
Sorry to make You feel embarassed.

BTW: This is the first time I really helped somebody out here... WOW! I feel smarter than an average webmaster due to my complete ignorance in the matter.
As an ignorant (but son of two programmists) I didn't assume that something has to work (DOS is my guide to life :) ) and I just tied to solve it the bluntest way there is. (You didn't bother to do a few tests, right? )

tedster

4:47 am on Feb 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE seems to treat the space " /" (space + slash) as a string " /"

THAT IS ONE HECK OF A SERIOUS BROWSER BUG WE HAVE!

Strictly speaking, is this really a bug? I think it might be intentional behavior, programmed that way by MS for reasons of their own. I honestly think you'd have to WORK to make this behavior happen.

There are no universal standards for line wrapping AFAIK, and wrapping algorithms must of necessity be language specific. So this is not, strictly speaking, a bug. But it is a very challenging Microsoft "feature".

Here's one guess that I think makes a kind of sense. The line wrapping algorithm in Internet Explorer does not allow a line break to be inserted if the new line created would begin with certain non-alphanumeric characters -- even when the potential "break" character is a regular space.

This may have roots in the evolution of Windows itself, where spaces have been allowed in file names since Win98. With the browser so closely tied to the OS, there is the need to recognize that in some situations a space may be smack in the middle of a file name.

Just my guesses here. I don't know for sure and haven't been able to uncover a document.That's mostly because many pages on microsoft.com do very strange line-wrapping when viewed with Opera ;)

nafmo

6:30 am on Feb 3, 2004 (gmt 0)

10+ Year Member



Yes, there is an "unversial standard" -- "Unicode Standard Annex #14: Line Breaking Properties". Parts of it is, however, only suggestions and not mandatory.