Next:
Text::Wigwam::Paths::Class
Previous:
Text::Wigwam::Modules::Core::Cgi
 [Table of Contents][Text::Wigwam Index]

Text::Wigwam::Modules::Core::Html



NAME

Text::Wigwam::Modules::Core::Html #html::escape, #html::unquote

Description

This module contains directives useful for managing data in HTML documents.

Directives

#html::escape string

Converts specific characters in string to their respective character entity references.

 [!!
  #html::escape "less than: <"    /* output: less than: &lt; */
  #html::escape "greater than: >" /* output: greater than: &gt; */
  #html::escape "quote: \""       /* output: quote: &quot; */
  #html::escape "ampersand: &"    /* output: ampersand: &amp; */
 !!]

 <Textarea rows=12 cols=80 name="blah">
 [!~ #html::escape !!>
 <html>
 <head><title>Sample HTML page</title></head>
 <body>
 content
 </body>
 </html>
 <!! ~!]
 </Textarea>
 [!!
  /* output:
   <Textarea rows=12 cols=80 name="blah">
   &lt;html&gt;
   &lt;head&gt;&lt;title&gt;Sample HTML page&lt;/title&gt;&lt;/head&gt;
   &lt;body&gt;
   content
   &lt;/body&gt;
   &lt;/html&gt;
   </Textarea>
  */
 !!]

#html::unquote string

Similar to #html::escape, but works only on the quotation character. It's used frequently in form widget value fields.

 [!! #define quote 'Bush Sr. "Read my lips"' !!]
 <Input type="text" name="quote" value="[!! #html::unquote quote !!]">
 [!!
  /* output:
   <Input type="text" name="quote" value="Bush Sr. &quot;Read my lips&quot;">
  */
 !!]