コード例 #1
0
ファイル: VisitorUrl.php プロジェクト: youthweb/bbcode-parser
 public function visitTextNode(TextNode $text_node)
 {
     $urllinker = new UrlLinker();
     // Email-Adressen sollen nicht verlinkt werden
     $urllinker->setEmailLinkCreator(function ($email, $content) {
         return $email;
     });
     $urllinker->setHtmlLinkCreator(function ($url, $content) {
         // Wir vergeben extra zweimal $url, weil $content durch UrlLinker gekürzt wird
         return Html::anchorFromConfig($url, $url, $this->config);
     });
     $text_node->setValue($urllinker->linkUrlsAndEscapeHtml($text_node->getValue()));
 }
コード例 #2
0
ファイル: SmileyVisitor.php プロジェクト: jasonbb/Haruko
 function visitTextNode(\JBBCode\TextNode $textNode)
 {
     /* Convert :) into an image tag. */
     $textNode->setValue(str_replace(':)', '<img src="/smiley.png" alt=":)" />', $textNode->getValue()));
 }
コード例 #3
0
ファイル: HTMLSafeVisitor.php プロジェクト: rhymix/rhymix
 public function visitTextNode(\JBBCode\TextNode $textNode)
 {
     $textNode->setValue($this->htmlSafe($textNode->getValue()));
 }
コード例 #4
0
 public function visitTextNode(TextNode $text_node)
 {
     $smiley_rules = $this->getSmileyRules();
     $text_node->setValue(str_replace($smiley_rules[0], $smiley_rules[1], $text_node->getValue()));
 }