You are here

public function TagPluginBase::prepare in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Plugin/TagPluginBase.php \Drupal\xbbcode\Plugin\TagPluginBase::prepare()

Transform an elements' content, to armor against other filters.

  • Use the inner content if all children will be rendered. (This just means the children's own ::prepare() functions are used.)
  • Use $tag->getSource() if no children will be rendered.
  • Traverse the tag's descendants for more complex cases.

Parameters

string $content: The content, after applying inner transformations.

\Drupal\xbbcode\Parser\Tree\TagElementInterface $tag: The original tag element.

Return value

string The prepared output.

Overrides TagPluginInterface::prepare

2 methods override TagPluginBase::prepare()
CodeTagPlugin::prepare in standard/src/Plugin/XBBCode/CodeTagPlugin.php
Transform an elements' content, to armor against other filters.
XBBCodeTestPlugin::prepare in tests/xbbcode_test_plugin/src/Plugin/XBBCode/XBBCodeTestPlugin.php
Transform an elements' content, to armor against other filters.

File

src/Plugin/TagPluginBase.php, line 158

Class

TagPluginBase
Provides a base class for XBBCode tag plugins.

Namespace

Drupal\xbbcode\Plugin

Code

public function prepare(string $content, TagElementInterface $tag) : string {
  return $content;
}