spaces in text ---> html

From: Peter Smith (psmith6_at_SparnBlock.bigpond.net.au)
Date: 12/19/03


Date: Fri, 19 Dec 2003 09:27:34 GMT

Hi

I am writing a message board, and the text is entered in a text box and
outputted in HTML. How can I keep the spaces formatting (ie use  's)
in the html output??

I use the standard decode lines:

    $value =~ tr/+/ /;

    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

but when I use

    $value =~ tr/+/"\&nbsp\;"/;

I get repeated &'s instead of spaces. Any help much appreciated..

- Peter



Relevant Pages

  • Re: Thoughts on mod_lisp
    ... writing templates in HTML and then inserting active ... > HTML with a static file than it is if you have to recompile and reload ... just as easy as C-x C-s, and I find writing lhtml easier than writing ...
    (comp.lang.lisp)
  • Re: Beginning, Middle and End
    ... Arranging my day so that I am doing my writing when I am naturally ... I *am* a real writer, and I have never come close to ... maybe I can do html -- add a few more pages of paper ... Black Flag starts falling behind schedule, ...
    (rec.arts.sf.composition)
  • utility functions within a class?
    ... I might be missing something obvious here, but I decided to experiment with writing a program that involves a class, so I'm somewhat new to this in Python. ... Specifically, I am writing a class that defines methods that wrap string arguments inside HTML elements, and ultimately creates and HTML page. ... First it will create a string with the proper DTD, then it will append the <head> element and the element, wrapped in the element. ...
    (comp.lang.python)
  • Re: Populate a combo with an array
    ... you want to interlace server-side scripting with HTML, ... I usually abstract as much processing as possible before writing any HTML. ... Unsolicited commercial email will be read at a cost of $500 per message. ... If your question is worth asking, ...
    (microsoft.public.inetserver.asp.general)
  • Re: command line vs gui
    ... Well, you have two choices as to what to do with html: ... > I would agree for a wysiwyg gui like Dreamweaver, ... Dreamweaver is a website maintenance tool, ... Writing is what Dreamweaver does as a sideline, ...
    (comp.os.linux.misc)