function HTMLRestrictions::getPlainTagsSubset

Same name and namespace in other branches
  1. 9 core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::getPlainTagsSubset()
  2. 11.x core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::getPlainTagsSubset()

Gets the subset of plain tags (no attributes) from allowed elements.

Return value

\Drupal\ckeditor5\HTMLRestrictions The subset of the given set of HTML restrictions.

File

core/modules/ckeditor5/src/HTMLRestrictions.php, line 1088

Class

HTMLRestrictions
Represents a set of HTML restrictions.

Namespace

Drupal\ckeditor5

Code

public function getPlainTagsSubset() : HTMLRestrictions {
    // This implicitly excludes wildcard tags and the global attribute `*` tag
    // because they always have attributes specified.
    return new self(array_filter($this->elements, function ($value) {
        return $value === FALSE;
    }));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.