예제 #1
0
 /**
  * Parses the markdown syntax and returns HTML.
  *
  * @param  string $text
  * @return string
  */
 public function __invoke($text)
 {
     return $this->parser->parse($text);
 }
예제 #2
0
 /**
  * Compile link.
  *
  * @param  array $cap
  * @param  array $link
  * @return string
  */
 protected function outputLink($cap, $link)
 {
     $href = Markdown::escape($link['href']);
     $title = $link['title'] ? Markdown::escape($link['title']) : null;
     return $cap[0][0] !== '!' ? $this->renderer->link($href, $title, $this->output($cap[1])) : $this->renderer->image($href, $title, Markdown::escape($cap[1]));
 }