Next: Text::Wigwam::Paths::Class | Previous: Text::Wigwam::Modules::Core::Cgi | [Table of Contents] | [Text::Wigwam Index] |
Text::Wigwam::Modules::Core::Html #html::escape, #html::unquote
This module contains directives useful for managing data in HTML documents.
Converts specific characters in string to their respective character entity references.
[!! #html::escape "less than: <" /* output: less than: < */ #html::escape "greater than: >" /* output: greater than: > */ #html::escape "quote: \"" /* output: quote: " */ #html::escape "ampersand: &" /* output: ampersand: & */ !!] <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"> <html> <head><title>Sample HTML page</title></head> <body> content </body> </html> </Textarea> */ !!]
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. "Read my lips""> */ !!]