Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Drupalamu_dud_custom_filtersPluginFilter;
- use DrupalComponentUtilityHtml;
- use DrupalfilterFilterProcessResult;
- use DrupalfilterPluginFilterBase;
- /**
- * Provides a filter to align elements.
- *
- * @Filter(
- * id = "iframe",
- * title = @Translation("iframe"),
- * description = @Translation(("restrict iframe to 100% height for responsiveness")),
- * type = DrupalfilterPluginFilterInterface::TYPE_TRANSFORM_REVERSIBLE
- * )
- */
- class AmuDudFilters extends FilterBase {
- /**
- * {@inheritdoc}
- */
- public function process($text, $langcode) {
- $result = new FilterProcessResult($text);
- if (stristr($text, 'data-align') !== FALSE) {
- $dom = Html::load($text);
- $result->setProcessedText(Html::serialize($dom));
- }
- return $result;
- }
Add Comment
Please, Sign In to add comment