docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 4.0Web Developer ManualText Tags
Copyright © 2006, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

<ai>
<autoformat>
<case>
<charset>
<comment>
<?comment ?>
<default>
<doc>
<foldlist>
<obox>
<random>
<recode>
<replace>
<smallcaps>
<sort>
<strlen>
<tablify>
<trimlines>
<wash-html>

<wash-html></wash-html>

Provided by module: Tags: HTML washer

This tag is mostly useful for turning user freetext input from a form into HTML intelligently, by turning sections of the text separated by more than one newline into <p>paragraphs</p>, filtering out or explicitly allowing some HTML tags in the input and creating <a>anchor-links</a> out of potential www-addresses.


Attributes

keep-all

Leave all tags containing info intact. Overrides the value of keep-tags and keep-containers. This attribute is useful together with the attributes unparagraphify and unlink.


<wash-html keep-all='1'>
  Some text, <i>italic</i>, <b>bold</b>,
  <i><b>bold italic</b></i>.

  <hr />A little image:<img src='/internal-roxen-next' />.
</wash-html>
Some text, italic, bold, bold italic.
A little image:.

keep-tags="list"

Comma-separated array of empty element <tags> not to filter. Quote all other empty element tags, i.e. transform "<", ">" and "&" to "&lt;", "&gt;" and "&amp;".


<wash-html keep-tags='hr'>
  Some text, <i>italic</i>, <b>bold</b>,
  <i><b>bold italic</b></i>.

  <hr />A litle image:<img src='/internal-roxen-next' />.
</wash-html>
Some text, <i>italic</i>, <b>bold</b>, <i><b>bold italic</b></i>.
A litle image:<img src='/internal-roxen-next' />.

keep-containers="list"

Comma-separated array of <container>...</> tags not to filter. Quote all other container tags, i.e. transform "<", ">" and "&" to "&lt;", "&gt;" and "&amp;".


<wash-html keep-containers='b'>
  Some text, <i>italic</i>, <b>bold</b>,
  <i><b>bold italic</b></i>.

  <hr />A little image:<img src='/internal-roxen-next' />.
</wash-html>
Some text, <i>italic</i>, bold, <i>bold italic</i>. <hr />A little image:<img src='/internal-roxen-next' />.

linkify

Makes text that looks like it might be useful as a link, e g http://www.roxen.com/, into a link. Text that starts with "http://", "https://", "ftp://", "www." or "http." will be converted to a clickable link with the text as the link label.


<wash-html linkify='a' keep-containers='a' keep-tags='br'>
  <a href="http://docs.roxen.com">Roxen docs</a><br />
  http://pike.roxen.com<br />
  www.roxen.com
</wash-html>
Roxen docs
http://pike.roxen.com
http://www.roxen.com

unlinkify

Undo a linkify-conversion. Only the links that has the same label as address will be converted to plain text.


<wash-html unlinkify='1' keep-tags='br' keep-containers='a'>
  <a href="http://www.roxen.com">http://www.roxen.com</a><br />
  <a href="http://www.roxen.com">Roxen IS</a>
</wash-html>
http://www.roxen.com
Roxen IS

remove-illegal-xml-chars

Removes illegal and discouraged XML characters. Legal characters include #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]. Discouraged characters include [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF], [#1FFFE-#x1FFFF], [#2FFFE-#x2FFFF], [#3FFFE-#x3FFFF], [#4FFFE-#x4FFFF], [#5FFFE-#x5FFFF], [#6FFFE-#x6FFFF], [#7FFFE-#x7FFFF], [#8FFFE-#x8FFFF], [#9FFFE-#x9FFFF], [#AFFFE-#xAFFFF], [#BFFFE-#xBFFFF], [#CFFFE-#xCFFFF], [#DFFFE-#xDFFFF], [#EFFFE-#xEFFFF], [#FFFFE-#xFFFFF], [#10FFFE-#x10FFFF]


paragraphify

If more than one newline exists between two text elements, this attribute automatically makes the next text element into a paragraph.


<wash-html paragraphify='1'>
A Paragraph

Another paragraph.
Some more text to the same paragraph.
</wash-html>
In the output source code, this would look like:
<p>
A Paragraph</p>
<p>Another paragraph.
Some more text to the same paragraph.
</p>

unparagraphify

Turn paragraph breaks into double newlines instead.


<wash-html unparagraphify='1'>
<p>A Paragraph</p>
<p>Another paragraph.
Some more text to the same paragraph.</p>
</wash-html>
In the output source code, this would look like:
A Paragraph

Another paragraph.
Some more text to the same paragraph.

The <pre> is only used in the example for layout-purposes.


close-tags

Terminate all tags with an ending slash, making them XML-compliant.