public function convert(ElementInterface $element) { $text = $element->getValue(); $size = $element->getAttribute('size'); $color = $element->getAttribute('color'); $bbcode = $text; if ($size) { $bbcode = "[size={$size}]{$bbcode}[/size]"; } if ($color) { $bbcode = "[color={$color}]{$bbcode}[/color]"; } return $bbcode; }
public function convert(ElementInterface $element) { $href = $element->getAttribute('href'); $text = $element->getValue(); $bbcode = '[url=' . $href . ']' . $text . '[/url]'; return $bbcode; }
public function convert(ElementInterface $element) { $src = $element->getAttribute('src'); $bbcode = "[img]{$src}[/img]"; return $bbcode; }