Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
I've been working on scripts where you put text into a browser form, including HTML, and then you preview, just like one does here.
When a preview happens, the text in the box gets put on on the browser page above, and the text remains editable in the form box below, just as happens here.
What happens if I want to put HTML brackets into the text in the box to demonstrate the use of an HTML tag?
I use < and > to get the brackets < and >, right?
When I preview, a regex changes those entities, so that they don't turn into HTML when saved.
If I only ever preview once, that's OK, but a second preview and they're double-coded.
Now I've got &amp;amp;lt; , and if I preview again, I'll get &amp;amp;amp;lt;
Is there a better regex? Or any other way to get around this?
--
($_='jjjuuusssttt annootthhrer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML Entities
by larryk (Friar) on Mar 07, 2002 at 09:26 UTC | |
|
Re: HTML Entities
by Juerd (Abbot) on Mar 07, 2002 at 12:06 UTC | |
by Hero Zzyzzx (Curate) on Mar 08, 2002 at 02:10 UTC |