1<?php 2 3namespace DokuWiki\Plugin\Mdpage; 4 5class Markdown { 6 const GITHUB_FLAVORED = 'GFM'; 7 const MARKDOWN_EXTRA = 'MarkdownExtra'; 8 const TRADITIONAL = 'Traditional'; 9 10 public static function parseWithRenderer( 11 $renderer, 12 $content, 13 $data, 14 $context 15 ) { 16 switch ($context['flavor']) { 17 case self::GITHUB_FLAVORED: 18 $parser = new Markdown\GitHubFlavored($renderer, $data, $context); 19 break; 20 case self::MARKDOWN_EXTRA: 21 $parser = new Markdown\MarkdownExtra($renderer, $data, $context); 22 break; 23 default: 24 $parser = new Markdown\Traditional($renderer, $data, $context); 25 break; 26 } 27 28 return $parser->parseOnce($content); 29 } 30} 31