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