note 13373 deleted from ref.strings by aidan

From: Date: Tue, 28 Sep 2004 12:12:39 +0000
Subject: note 13373 deleted from ref.strings by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-77499@lists.php.net to get a copy of this message
Note Submitter: david at audiogalaxy dot com ---- Browsers (Internet Explorer at least) won't wrap text immediately before puntuation . ? ! ( ) [ ] { } / even if the preceeding character is whitespace. I believe this is intentional widow/orphan prevention behavior. This complicates the processing of user-inputed text (e.g. the message board junk problem). Even if you use <textarea wrap=hard> to force newlines into the input text (which is imperfect since a clever user can just modify the HTML before posting), people posting long strings of punctuation characters, or just punctuation characters at the beginning of each line in the <textarea> will mess up the format of the page for users viewing their post. You obviously can't solve this by just inserting a spaces - the browser still won't wrap. My solution is to use str_replace to put a &nbsp; (the least visually impacting non-whitespace character I can think of) between the \n and any pucntuation so the wrap can happen in the whitespace before the &nbsp;. Kindof ironic to be using &nbsp; to *cause* a break:) [Editor's note: You could also use wordwrap() function Maxim Maletsky]

« previous php.notes (#77499) next »