HesaSys
[ class tree: HesaSys ] [ index: HesaSys ] [ all elements ]

Class: WikiParser

Source Location: /class.wiki.php

Class Overview


Parses html2wiki or wiki2html


Methods



Class Details

[line 37]
Parses html2wiki or wiki2html



[ Top ]


Class Methods


method hte [line 194]

string hte( string $str)

Returns a html-escaped (htmlspecialchars) string



Tags:



Parameters:

string   $str   The string

[ Top ]

method html2wiki [line 135]

string html2wiki( string $str, [bool $reverse = false])

Opposite of the wiki2html method.



Tags:



Parameters:

string   $str   String to parse
bool   $reverse   replace <p>foo</p> with \nfoo\n?

[ Top ]

method reverse [line 183]

string reverse( string $str)

Alias for WikiParser::html2wiki with reverse = true



Tags:

usedby:  WikiParser::wiki2html()
uses:  WikiParses::html2wiki()


Parameters:

string   $str   String to parse

[ Top ]

method wiki2html [line 82]

string wiki2html( string $str)

Parses wiki to html

Formatting:

  • **foo** -> <strong>foo</strong>
  • //foo// -> <em>foo</em>
  • __foo__ -> <u>foo</u>
  • ''foo'' -> <code>foo</code>
  • foo\n -> foo<br />
  • \nfoo\n -> <p>foo</p>
Links:
  • [[http://foo.tld]] -> <a href="http://foo.tld">http://foo.tld</a>
  • [[http://foo.tld|foo]] -> <a href="http://foo.tld">foo</a>
  • [[foo]] -> <a href="{cms:link foo}">foo</a>
  • [[foo|bar]] -> <a href="{cms:link foo}">bar</a>
Images:
  • {{http://foo.ext}} -> <img src="http://foo.ext" />
  • {{http://foo.ext|12}} -> <img src="http://foo.ext" width="12" />
  • {{http://foo.ext|12x30}} -> <img src="http://foo.ext" width="12" height="30" />
  • {{foo.ext}} -> <img src="{cms:absoluteuri}foo.ext" />
  • {{foo.ext|12}} -> <img src="{cms:absoluteuri}foo.ext" width="12" />
  • {{foo.ext|12x30}} -> <img src="{cms:absoluteuri}foo.ext" width="12" height="30" />
Generally: Add an additional "|str" before every image tag's closing brackets to define the html 'alt'-parameter. For instance: {{http://foo.ext|foo}} -> <img src="http://foo.ext" alt="foo" /> PLEASE NOTE: For some limitations the alt text can NOT begin with a decimal!

HTML:

  • <html>foo</html>
Reverse (do not parse):
  • <noparse>foo</noparse>




Tags:



Parameters:

string   $str   The String to parse

[ Top ]


Documentation generated on Sat, 20 May 2006 15:56:04 +0200 by phpDocumentor 1.3.0RC6