public function parse($markdown)
 {
     $document = $this->wrapped->parse($markdown);
     $document->title = $this->getTitle($document->htmlContent);
     $document->sections = $this->getAvailableSections($document->htmlContent);
     return $document;
 }
 public function parse($markdown)
 {
     $markdown = preg_replace_callback('/^#+ +([^\\{\\n]+)$/m', function (array $matches) {
         $title = self::headlineTextToHtmlId($matches[1]);
         return sprintf('%s {#%s}', $matches[0], $title);
     }, $markdown);
     return $this->wrapped->parse($markdown);
 }
 public function parse($markdown)
 {
     $document = $this->wrapped->parse($markdown);
     $html = $document->htmlContent;
     $html = preg_replace('/href="([^(http)].*?)(.md)(.*?)"/', 'href="${1}${3}"', $html);
     $html = preg_replace('/href="((..\\/)+)Piwik(.*?)(.md)(.*?)"/', 'href="${1}Piwik${3}${5}"', $html);
     $document->htmlContent = $html;
     return $document;
 }