function HTMLRestrictions::fromTextFormat

Same name in other branches
  1. 10 core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::fromTextFormat()
  2. 11.x core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::fromTextFormat()

Constructs a set of HTML restrictions matching the given text format.

Parameters

\Drupal\filter\FilterFormatInterface $text_format: A text format to construct a HTML restrictions object for.

Return value

\Drupal\ckeditor5\HTMLRestrictions

6 calls to HTMLRestrictions::fromTextFormat()
ckeditor5_filter_format_edit_form_submit in core/modules/ckeditor5/ckeditor5.module
Form submission handler for filter format forms.
FundamentalCompatibilityConstraintValidator::checkHtmlRestrictionsAreCompatible in core/modules/ckeditor5/src/Plugin/Validation/Constraint/FundamentalCompatibilityConstraintValidator.php
Checks that fundamental CKEditor 5 plugins' HTML tags are allowed.
SmartDefaultSettings::addToolbarItemsToMatchHtmlElementsInFormat in core/modules/ckeditor5/src/SmartDefaultSettings.php
Adds CKEditor 5 toolbar items to match the format's HTML elements.
SmartDefaultSettings::computeSmartDefaultSettings in core/modules/ckeditor5/src/SmartDefaultSettings.php
Computes the closest possible equivalent settings for switching to CKEditor 5.
SmartDefaultSettingsTest::test in core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php
Tests the CKEditor 5 default settings conversion.

... See full list

File

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

Class

HTMLRestrictions
Represents a set of HTML restrictions.

Namespace

Drupal\ckeditor5

Code

public static function fromTextFormat(FilterFormatInterface $text_format) : HTMLRestrictions {
    return self::fromObjectWithHtmlRestrictions($text_format);
}

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