Thursday, March 22, 2007

Small tool to escape HTML text for postings

Hi guys, when I post answers in the forum, I often have to copy / paste HTML sequences, which will have to be escaped, else they mess up the posting itself.

For example, you cannot use
<a href="">link</a> 
directly in a posting, you would have to escape it first to:
&lt;a href="">link&lt;/a>. 
This is accomplished by replacing the opening bracket < with the html escape sequence &lt;

You can find the tool here: http://apex.oracle.com/pls/otn/f?p=daust_demos:tools_escape_text

I use it quite often.

Enjoy,
~Dietmar.

3 comments:

BoeroBoy said...

Maybe this was created after this article was posted, but

HTF.escape_sc

supports this nicely.
FYI, anyone reading this.

daust_de said...

Yes, you are right. This would work as well.

Escaping the opening bracket is the minial thing you need to do.

This would even work any text editor by replacing the "<" character.

Regards,
~Dietmar.

Sandra said...

Such a great article which often have to copy / paste HTML sequences, which will have to be escaped, else they mess up the posting itself. In which This is accomplished by replacing the opening bracket. Thanks for sharing.