wiki:Reference/Markup

Markup

Parsers

bbCode

MarkupHTMLClassDescription
[b]Text[/b]<strong>text</strong>n/aStrong (bold) text
[i]Text[/i]<em>text</em>n/aEmphasized (italic) text
[u]Text[/u]<u>text</u>n/aUnderlined text
[url=link]Text[/url]<a href="link">text</u>n/aLink to another site
[image=src]<img src="src">n/aInsert image

Wiki

MarkupHTMLClassDescription
= Text =<h1>text</h1>n/aFirst level heading
== Text ==<h2>text</h2>n/aSecond level heading
=== Text ===<h3>text</h3>n/aThird level heading
'''Text'''<strong>text</strong>n/aBold/strong text

Safe HTML

Human

MarkupHTMLClassDescription
*word*<strong>word</strong>n/aBold/strong text
_word_<underline>word</underline>n/aUnderlined text
/word/<em>word</em>n/aItalic/Emphasized? text
#wordn/an/aTag
!wordn/an/aGroup
@wordn/an/aAddressing

Using

// Parse $text and output the parsed version
$p = Markup::parse('bbcode',$text);
echo $p;

// Alternative way
$p = Markup::getParser('bbcode');
echo $p->parse($text);

}}}

Writing parsers