MarkdownExtra_Parser(); $this->no_markup = true; $this->no_entities = true; } // overload to allow only some HTML tags function hashHTMLBlocks($text) { return preg_replace_callback('{<('.$this->allowed_tags.')>.*?}', array(&$this, '_hashBlock'), $text); } function _hashBlock($matches) { return $this->hashBlock($matches[0]); } // overload to accept allowed tags function transform($input, $allowed_tags) { $allowed_tags = preg_split('#[^a-zA-Z1-6]+#', $allowed_tags); $this->allowed_tags = implode('|', $allowed_tags); return parent::transform($input); } } function MarkdownWithoutMarkup($text, $allowed_tags = '') { static $parser; if (!isset($parser)) { $parser = new MarkdownWithoutMarkup_Parser; } $return = $parser->transform($text, $allowed_tags); return $return; }