Пример #1
0
 /**
  * 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', '');
 }
Пример #2
0
 /**
  * @param Text $text
  */
 public function unescapeSpecialChars(Text $text)
 {
     foreach ($this->hashes as $char => $hash) {
         $text->replaceString($hash, $char);
     }
 }
Пример #3
0
 /**
  * @param Text $text
  */
 protected function unescapePipes(Text $text)
 {
     $text->replaceString($this->hash, '|');
 }
Пример #4
0
 /**
  * @param Text $text
  */
 public function unhashHtmlBlocks(Text $text)
 {
     foreach ($this->markdown->getHashRegistry() as $hash => $html) {
         $text->replaceString($hash, trim($html));
     }
 }