public function FilterHtml::process in Panopoly 8.2
Performs the filter processing.
Parameters
string $text: The text string to be filtered.
string $langcode: The language code of the text to be filtered.
Return value
\Drupal\filter\FilterProcessResult The filtered text, wrapped in a FilterProcessResult object, and possibly with associated assets, cacheability metadata and placeholders.
Overrides FilterHtml::process
See also
\Drupal\filter\FilterProcessResult
File
- modules/
panopoly/ panopoly_wysiwyg/ src/ Plugin/ Filter/ FilterHtml.php, line 18
Class
- FilterHtml
- Replacement for core FilterHtml that respects <!--break-->.
Namespace
Drupal\panopoly_wysiwyg\Plugin\FilterCode
public function process($text, $langcode) {
// Split the text on <!--break-->, then do the normal processing and
// re-join.
$parts = explode('<!--break-->', $text, 2);
foreach ($parts as &$part) {
$part = parent::process($part, $langcode)
->getProcessedText();
}
$text = count($parts) > 1 ? implode('<!--break-->', $parts) : $parts[0];
return new FilterProcessResult($text);
}