/** * Convert line breaks * * @param Text $text */ public function initialize(Text $text) { $text->replaceString("\r\n", "\n"); $text->replaceString("\r", "\n"); $text->append("\n\n"); $this->markdown->emit('detab', array($text)); $text->replace('/^[ \\t]+$/m', ''); }
/** * @param Text $text */ public function unescapeSpecialChars(Text $text) { foreach ($this->hashes as $char => $hash) { $text->replaceString($hash, $char); } }
/** * @param Text $text */ protected function unescapePipes(Text $text) { $text->replaceString($this->hash, '|'); }
/** * @param Text $text */ public function unhashHtmlBlocks(Text $text) { foreach ($this->markdown->getHashRegistry() as $hash => $html) { $text->replaceString($hash, trim($html)); } }