コード例 #1
0
 public function render(Node $node, $content)
 {
     if (!isset($this->tags[$node->getType()])) {
         throw new TagNotFoundException('No rendering strategy found for tag type: ' . $node->getType());
     }
     return $this->tags[$node->getType()]->render($node, $content);
 }
コード例 #2
0
 public function render(Node $node, $text)
 {
     $alt = $node->getAttribute('alt');
     $src = $node->getAttribute('src');
     $title = $this->getOptionalTitle($node->getAttribute('title'));
     return "![{$alt}]({$src}{$title})";
 }
コード例 #3
0
 public function render(Node $node, $text)
 {
     $html = '<' . $node->getType() . $this->arrayToHtmlAttributes($node->getAttributes()) . '>';
     $html .= $node->getText();
     $html .= '</' . $node->getType() . '>';
     return $html;
 }
コード例 #4
0
ファイル: ATag.php プロジェクト: heybigname/html-to-markdown
 public function render(Node $node, $text)
 {
     $href = $node->getAttribute('href');
     $text = $node->getText();
     return "[{$text}]({$href})";
 }
コード例 #5
0
 public function render(Node $node, $text)
 {
     return $this->cleanInitialWhitespace($node->getText());
 }