public function toHTML() { $text = $this->text; // block $text = $this->parseBox($text); $text = $this->parseCode($text); $text = $this->parseList($text); $text = $this->parseNotice($text); $text = $this->parseQuote($text); $text = $this->parseHeading($text); $text = $this->clearSpacesBetweenTags($text); // inline $text = $this->parseBold($text); $text = $this->parseCentre($text); $text = $this->parseColour($text); $text = $this->parseEmail($text); $text = $this->parseImage($text); $text = $this->parseItalic($text); $text = $this->parseSize($text); $text = $this->parseSmilies($text); $text = $this->parseSpoiler($text); $text = $this->parseStrike($text); $text = $this->parseUnderline($text); $text = $this->parseUrl($text); $text = $this->parseYoutube($text); $text = $this->parseProfile($text); $text = preg_replace('/\\n/', "\n<br />", $text); $text = CleanHTML::purify($text); return "<div class='bbcode'>{$text}</div>"; }
public function toHTML($ignoreLineHeight = false) { $text = $this->text; // block $text = $this->parseBox($text); $text = $this->parseCode($text); $text = $this->parseList($text); $text = $this->parseNotice($text); $text = $this->parseQuote($text); $text = $this->parseHeading($text); $text = $this->clearSpacesBetweenTags($text); // inline $text = $this->parseAudio($text); $text = $this->parseBold($text); $text = $this->parseCentre($text); $text = $this->parseColour($text); $text = $this->parseEmail($text); $text = $this->parseImage($text); $text = $this->parseItalic($text); $text = $this->parseSize($text); $text = $this->parseSmilies($text); $text = $this->parseSpoiler($text); $text = $this->parseStrike($text); $text = $this->parseUnderline($text); $text = $this->parseUrl($text); $text = $this->parseYoutube($text); $text = $this->parseProfile($text); $text = str_replace("\n", '<br />', $text); $text = CleanHTML::purify($text); $className = 'bbcode'; if ($ignoreLineHeight) { $className .= ' bbcode--normal-line-height'; } return "<div class='{$className}'>{$text}</div>"; }