function FundamentalCompatibilityConstraintValidator::checkNoMarkupFilters
Same name in other branches
- 10 core/modules/ckeditor5/src/Plugin/Validation/Constraint/FundamentalCompatibilityConstraintValidator.php \Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraintValidator::checkNoMarkupFilters()
- 11.x core/modules/ckeditor5/src/Plugin/Validation/Constraint/FundamentalCompatibilityConstraintValidator.php \Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraintValidator::checkNoMarkupFilters()
Checks no TYPE_MARKUP_LANGUAGE filters are present.
Two TYPE_MARKUP_LANGUAGE filters are exempted:
- filter_autop: pointless but harmless to have enabled
- filter_url: not recommended but also harmless to have enabled
These two commonly enabled filters with a long history in Drupal are considered to be acceptable to have enabled.
Parameters
\Drupal\filter\FilterFormatInterface $text_format: The text format to validate.
\Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraint $constraint: The constraint to validate.
1 call to FundamentalCompatibilityConstraintValidator::checkNoMarkupFilters()
- FundamentalCompatibilityConstraintValidator::validate in core/
modules/ ckeditor5/ src/ Plugin/ Validation/ Constraint/ FundamentalCompatibilityConstraintValidator.php
File
-
core/
modules/ ckeditor5/ src/ Plugin/ Validation/ Constraint/ FundamentalCompatibilityConstraintValidator.php, line 97
Class
- FundamentalCompatibilityConstraintValidator
- Validates fundamental compatibility of CKEditor 5 with the given text format.
Namespace
Drupal\ckeditor5\Plugin\Validation\ConstraintCode
private function checkNoMarkupFilters(FilterFormatInterface $text_format, FundamentalCompatibilityConstraint $constraint) : void {
$markup_filters = static::getFiltersInFormatOfType($text_format, FilterInterface::TYPE_MARKUP_LANGUAGE);
foreach ($markup_filters as $markup_filter) {
if ($markup_filter instanceof FilterAutoP || $markup_filter instanceof FilterUrl) {
continue;
}
$this->context
->buildViolation($constraint->noMarkupFiltersMessage)
->setParameter('%filter_label', (string) $markup_filter->getLabel())
->setParameter('%filter_plugin_id', $markup_filter->getPluginId())
->addViolation();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.