Exemple #1
0
 public function __construct(array $features = array())
 {
     foreach ($this->features as $name => $enabled) {
         $this->features[$name] = false;
     }
     return parent::__construct($features);
 }
    public function doFencedCodeBlocks($text)
    {
        $text = preg_replace_callback('{
                (?:\\n|\\A)
                # 1: Opening marker
                (
                    `{3,} # Marker: three tilde or more.
                )
                [ ]* \\n # Whitespace and newline following marker.

                # 2: Content
                (
                    (?>
                        (?!\\1 [ ]* \\n)	# Not a closing marker.
                        .*\\n+
                    )+
                )

                # Closing marker.
                \\1 [ ]* \\n
            }xm', array(&$this, '_doFencedCodeBlocks_callback'), $text);
        return parent::doFencedCodeBlocks($text);
    }
 /**
  * Transforms markdown syntax to HTML
  * @param   string  $markdownText   The markdown syntax text
  * @return  string                  The HTML code
  */
 public function transform($markdownText)
 {
     return $this->parser->transform($markdownText);
 }
 private function markdown_parse($text)
 {
     $output = MarkdownParser::defaultTransform($text);
     $output = $this->strip_tags($output);
     return $output;
 }