3 namespace Drupal\filter_test\Plugin\Filter;
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
9 * Provides a test filter to replace all content.
12 * id = "filter_test_replace",
13 * title = @Translation("Testing filter"),
14 * description = @Translation("Replaces all content with filter and text format information."),
15 * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE
18 class FilterTestReplace extends FilterBase {
23 public function process($text, $langcode) {
25 $text[] = 'Filter: ' . $this->getLabel() . ' (' . $this->getPluginId() . ')';
26 $text[] = 'Language: ' . $langcode;
27 return new FilterProcessResult(implode("<br />\n", $text));