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())); }
function visitTextNode(\JBBCode\TextNode $textNode) { /* Convert :) into an image tag. */ $textNode->setValue(str_replace(':)', '<img src="/smiley.png" alt=":)" />', $textNode->getValue())); }
public function visitTextNode(\JBBCode\TextNode $textNode) { $textNode->setValue($this->htmlSafe($textNode->getValue())); }
public function visitTextNode(TextNode $text_node) { $smiley_rules = $this->getSmileyRules(); $text_node->setValue(str_replace($smiley_rules[0], $smiley_rules[1], $text_node->getValue())); }