You are here

public function XBBCodeFilter::prepare in Extensible BBCode 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/Filter/XBBCodeFilter.php \Drupal\xbbcode\Plugin\Filter\XBBCodeFilter::prepare()

Prepares the text for processing.

Filters should not use the prepare method for anything other than escaping, because that would short-circuit the control the user has over the order in which filters are applied.

Parameters

string $text: The text string to be filtered.

string $langcode: The language code of the text to be filtered.

Return value

string The prepared, escaped text.

Overrides FilterBase::prepare

File

src/Plugin/Filter/XBBCodeFilter.php, line 216

Class

XBBCodeFilter
Provides a filter that converts BBCode to HTML.

Namespace

Drupal\xbbcode\Plugin\Filter

Code

public function prepare($text, $langcode) : string {
  $tree = $this->parser
    ->parse($text);
  return static::doPrepare($tree);
}