Exemple #1
0
 protected function onShortcode($content, $code, \Drone\HTML &$html)
 {
     $html = HTML::make($this->so('advanced/tag'))->class($this->so('type') . '-only')->add(Func::wpShortcodeContent($content));
 }
Exemple #2
0
 protected function onShortcode($content, $code, \Drone\HTML &$html)
 {
     $content = Func::wpShortcodeContent($content, false);
     if ($this->so('tag') == 'pre') {
         $content = preg_replace('#(<br ?/?>|^<p>|</p>$)#i', '', $content);
         $content = preg_replace('#(</p>\\r?\\n<p>|</p>\\r?\\n|\\r?\\n<p>)#i', "\n\n", $content);
     }
     $content = htmlspecialchars($content, defined('ENT_HTML5') ? ENT_COMPAT | ENT_HTML5 : ENT_COMPAT, get_bloginfo('charset'), false);
     $html = HTML::$tag()->add($content);
     if ($this->so('class')) {
         $html->class = $this->so('class');
     }
 }