public function ConvertLegacyMediaTagsToMarkup::process in Convert Media Tags to Markup 2.x
Same name and namespace in other branches
- 8 src/Plugin/Filter/ConvertLegacyMediaTagsToMarkup.php \Drupal\convert_media_tags_to_markup\Plugin\Filter\ConvertLegacyMediaTagsToMarkup::process()
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 FilterInterface::process
See also
\Drupal\filter\FilterProcessResult
File
- src/
Plugin/ Filter/ ConvertLegacyMediaTagsToMarkup.php, line 29
Class
- ConvertLegacyMediaTagsToMarkup
- Provides a filter for converting legacy media tags to markup.
Namespace
Drupal\convert_media_tags_to_markup\Plugin\FilterCode
public function process($text, $langcode) {
try {
return new FilterProcessResult(App::instance()
->filterText($text));
} catch (\Exception $e) {
$this
->watchdogException($e);
return new FilterProcessResult($text);
}
}