You are here

public function MappingFieldsFilter::process in Gutenberg 8

Process all content.

Overrides FilterInterface::process

File

src/Plugin/Filter/MappingFieldsFilter.php, line 55

Class

MappingFieldsFilter
Class MappingFieldsFilter.

Namespace

Drupal\gutenberg\Plugin\Filter

Code

public function process($text, $langcode) {
  $text = preg_replace_callback('#((<!-- .*\\{.*"mappingFields".*} -->)([\\s\\S]*?)(<!-- \\/[\\s\\S]*?-->)|(<!-- .*\\{.*"mappingFields".*} \\/-->))#', [
    $this,
    'renderWithoutMappingFields',
  ], $text);
  return new FilterProcessResult($text);
}