public function CodeTagPlugin::doProcess in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 standard/src/Plugin/XBBCode/CodeTagPlugin.php \Drupal\xbbcode_standard\Plugin\XBBCode\CodeTagPlugin::doProcess()
Create the actual output.
Tag plugins should override this function rather than ::process(), in order to let the metadata from sub-tags bubble up.
Parameters
\Drupal\xbbcode\Parser\Tree\TagElementInterface $tag: Tag element in the parse tree.
Return value
\Drupal\xbbcode\TagProcessResult Tag process result.
Overrides TagPluginBase::doProcess
File
- standard/
src/ Plugin/ XBBCode/ CodeTagPlugin.php, line 37
Class
- CodeTagPlugin
- Prints raw code.
Namespace
Drupal\xbbcode_standard\Plugin\XBBCodeCode
public function doProcess(TagElementInterface $tag) : TagProcessResult {
$source = Html::escape(Utf8::decode($tag
->getSource()));
return new TagProcessResult("<code>{$source}</code>");
}