in reply to Re: A call to keyboards: Better chatterbox wrapping
in thread A call to keyboards: Better chatterbox wrapping

This is pretty much the kind of thing we are looking for. But its mangled the href in the A tag for the BBC. Its essential that the wrapping text doesnt mess with the insides of tags or anything that HTML would normally render. So &amp; cant be wrapped internally. Likewise anything inside of a tag should be left alone. (You can use /<[^>]+>/ for matching tags, we aren't that picky.)

Note that the content of the chatter has been preprocess before this code executes, so you dont need to worry about fake tags or anthing like that. If something is a valid tag it will match /<[^>]+>/ already. Anything that isnt valid will be modified to not match that pattern.

---
demerphq

Replies are listed 'Best First'.
Re^3: A call to keyboards: Better chatterbox wrapping
by BrowserUk (Patriarch) on Jan 10, 2005 at 15:22 UTC

    I've updated again to correct that. Any other awkward cases that you know of?


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.

      the only thing that occurs to me is that you seem to have mistaken URL encoded entities with HTML entities. HTML Entities look like: &#91; &#93; &lt; &gt; [ ] < >

      ---
      demerphq

        Your right, I used URI::Escape when I should have used HTML::Entities, and the difference does break the code, as it will break "e; just before the ; sometimes. I think this fixes that.

        Version 4(?)


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.