Welcome to MSDN Blogs Sign in | Join | Help

Internet Explorer wordwrap doesn't break at commas

I was modifying my web based thumbnail image viewer. Under each thumb I wanted the description of the photo. I wanted the photos to have captions below, and the unit to be rendered horizontally so they will fill the IE width. However, Internet Explorer will not break a line to wordwrap text after a comma if there is no space after it “like,this”. I didn’t want to modify the text in the database and insert spaces. One solution would be to find all occurrences of comma followed by a non-space and replace with comma space plus the non-space character. A simpler way: I just added a line to the HTML generator:

 

      notes= STRTRAN(STRTRAN(notes,",",", "),"  "," ")      && so IE wordwraps

 

First it replaces all commas with comma space, then it replaces all double spaces with a single space. This is extra work if the comma already had a space after it, but it was easy to do and the amount of extra work is peanuts compared to the disk I/O to get the thumbnail image.

 

Published Wednesday, August 03, 2005 5:37 PM by Calvin_Hsia
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Internet Explorer wordwrap doesn't break at commas

Thursday, August 04, 2005 2:09 AM by Name
[url=http://music.tt33.net]在线音乐[/url]
[url=http://movie.tt33.net]免费电影[/url]
[url=http://game.tt33.net]小游戏[/url]
[url=http://www.tt22.net]娱乐中心[/url]
[url=http://music.tt22.net]音乐宝典[/url]
[url=http://movie.tt22.net]在线电影[/url]
[url=http://game.tt22.net]小游戏中心[/url]
[url=http://lrc.tt22.net]歌词宝典[/url]
[url=http://www.tt55.net]在线小游戏[/url]

# re: Internet Explorer wordwrap doesn't break at commas

Thursday, August 04, 2005 6:23 AM by anon

So you are going to replace commas in number thousand operators for instance. Cool, I can't wait to see this.

# re: Internet Explorer wordwrap doesn't break at commas

Thursday, August 04, 2005 10:43 AM by Malcolm Greene
Calvin,

In addition to the issue with thousand seperators, there's also the issue of commas embedded in URL's that may also be in your notes?

Also, I've found that I need to put space compression in a loop if you think there will be more than 5 spaces in a row in your content, i.e.

do while " " $ lcStr
lcStr = strtran( lcStr, " ", " " )
enddo

Malcolm

# re: Internet Explorer wordwrap doesn't break at commas

Thursday, August 04, 2005 5:16 PM by David Fung
From the original post of replacing double spaces with single space, why bother to do so? I thought HTML will treat multiple spaces as one.

# re: Internet Explorer wordwrap doesn't break at commas

Friday, August 05, 2005 2:12 PM by Calvin_Hsia
Since my photograph descriptions don't have large numbers or URLs, the issues of commas as thousands separator or in URLs don't matter to me. I wanted the descriptions to wordwrap and fit under the thumbnails, using DIV tags. IE will automatically wordwrap, but only at spaces.

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker