Roxen.git / server / modules / tags / html_wash.pike

version» Context lines:

Roxen.git/server/modules/tags/html_wash.pike:1:   // This is a roxen module. Copyright © 2000, Roxen IS.   //      #include <module.h>   inherit "module";    - constant cvs_version = "$Id: html_wash.pike,v 1.13 2000/09/15 09:17:51 kuntri Exp $"; + constant cvs_version = "$Id: html_wash.pike,v 1.14 2001/03/07 13:42:11 kuntri Exp $";   constant thread_safe = 1;   constant module_type = MODULE_TAG;   constant module_name = "HTML washer";   constant module_doc =   #"<p>This module provides a &lt;wash-html&gt; tag that is perhaps most   useful for turning user freetext input from a form into HTML   intelligently; perhaps turning sections separated by more than one   newline into &lt;p&gt;paragraphs&lt;/p&gt;, filtering out or   explicitly allowing some HTML tags in the input</p>   
Roxen.git/server/modules/tags/html_wash.pike:172:    Regexp("(((http)|(https)|(ftp))://([^ \t\n\r<]+)(\\.[^ \t\n\r<>\"]+)+)|"    "(((www)|(ftp))(\\.[^ \t\n\r<>\"]+)+)");    }   }      // --------------------- Documentation -----------------------      TAGDOCUMENTATION;   #ifdef manual   constant tagdoc=([ - "wash-html":#"<desc cont><short hide> + "wash-html":#"<desc cont='cont'><p><short hide='hide'> +  Turns a text into HTML.</short>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 +  <tag>p</tag>paragraphs<tag>/p</tag>, filtering out or explicitly +  allowing some HTML tags in the input and creating +  <tag>a</tag>anchor-links<tag>/a</tag> out of potential www-addresses. + </p></desc>    -  </short> -  - </desc> -  - <attr name='keep-all'> + <attr name='keep-all'><p>    Leave all tags containing info intact. Overrides the value of    keep-tags and keep-containers. This attribute is useful together with -  the attributes <att>unparagraphify</att> and <att>unlink</att>. +  the attributes <att>unparagraphify</att> and <att>unlink</att>.</p>      <ex type='vert'>   <wash-html keep-all=''>    Some text, <i>italic</i>, <b>bold</b>, <i><b>bold italic</b></i>.    -  <hr>A litle image:<img src='/internal-roxen-next'>. +  <hr>A little image:<img src='/internal-roxen-next'>.   </wash-html>   </ex>   </attr>    - <attr name='keep-tags' value='list'> -  -  Comma-separated array of empty element <tag>tags/</tag> not to -  filter. Quote all other empty element tags e.i. transform \"&lt;\", + <attr name='keep-tags' value='list'><p> +  Comma-separated array of empty element <tag>tags</tag> not to +  filter. Quote all other empty element tags i.e. transform \"&lt;\",    \"&gt;\" and \"&amp;\" to \"&amp;lt;\", \"&amp;gt;\" and -  \"&amp;amp;\". +  \"&amp;amp;\".</p>      <ex type='vert'>   <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'>. +  <hr />A litle image:<img src='/internal-roxen-next'>.   </wash-html>   </ex>   </attr>    - <attr name='keep-containers' value='list'> + <attr name='keep-containers' value='list'><p>    Comma-separated array of <tag>container</tag>...<tag>/</tag> tags not    to filter. Quote all other container tags e.i. transform \"&lt;\",    \"&gt;\" and \"&amp;\" to \"&amp;lt;\", \"&amp;gt;\" and -  \"&amp;amp;\". +  \"&amp;amp;\".</p>      <ex type='vert'>   <wash-html keep-containers='b'>    Some text, <i>italic</i>, <b>bold</b>, <i><b>bold italic</b></i>.    -  <hr>A litle image:<img src='/internal-roxen-next'>. +  <hr>A little image:<img src='/internal-roxen-next'>.   </wash-html>   </ex>   </attr>    - <attr name='linkify'> + <attr name='linkify'><p>    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. +  converted to a clickable link with the text as the link label.</p>      <ex type='vert'>   <wash-html linkify='' keep-containers='a' keep-tags='br'> -  <a href=\"http://docs.roxen.com\">Documentation for Roxen products</a><br /> +  <a href=\"http://docs.roxen.com\">Roxen docs</a><br />    http://pike.roxen.com<br />    www.roxen.com   </wash-html>   </ex>   </attr>    - <attr name='unlinkify'> + <attr name='unlinkify'><p>    Undo a linkify-conversion. Only the links that has the same label as -  address will be converted to plain text. +  address will be converted to plain text.</p>      <ex type='vert'>   <wash-html unlinkify='' 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>   </ex>   </attr>    - <attr name='paragraphify'> + <attr name='paragraphify'><p>    If more than one newline exists between two text elements, this -  attribute automatically makes the next text element into a paragraph. +  attribute automatically makes the next text element into a +  paragraph.</p>      <ex type='vert'>   <wash-html paragraphify=''>   A Paragraph      An other paragraph.   And some more text to the same paragraph.   </wash-html>   </ex>   </attr>    - <attr name='unparagraphify'> -  Turn paragraph breaks into double newlines instead. + <attr name='unparagraphify'><p> +  Turn paragraph breaks into double newlines instead.</p>      <ex type='vert'>   <pre><wash-html unparagraphify=''>   <p>A Paragraph<p>      <p>An other paragraph.   And some more text to the same paragraph.</p>   </wash-html></pre> - </ex> -  The <tag>pre</tag> is only used in the example for layout-purposes. + </ex><p> +  The <tag>pre</tag> is only used in the example for layout-purposes.</p>   </attr>    - <attr name='close-tags'> -  Terminate all tags with an ending slash, making them XML-compliant. + <attr name='close-tags'><p> +  Terminate all tags with an ending slash, making them XML-compliant.</p>   </attr>",       ]);   #endif