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:
Reverse (do not parse):
Tags:
Parameters: