function CKEditor5UpdateImageToolbarItemTest::getSourceEditingRestrictions
Gets the configured HTML restrictions for the Source Editing plugin.
Parameters
\Drupal\editor\EditorInterface $editor: Text editor configured to use CKEditor 5, with Source Editing enabled.
Return value
\Drupal\ckeditor5\HTMLRestrictions The configured HTML restrictions.
File
-
core/
modules/ ckeditor5/ tests/ src/ Functional/ Update/ CKEditor5UpdateImageToolbarItemTest.php, line 181
Class
- CKEditor5UpdateImageToolbarItemTest
- Tests the update path for the CKEditor 5 image toolbar item.
Namespace
Drupal\Tests\ckeditor5\Functional\UpdateCode
private static function getSourceEditingRestrictions(EditorInterface $editor) : HTMLRestrictions {
$settings = $editor->getSettings();
$source_editing_allowed_tags = $settings['plugins']['ckeditor5_sourceEditing']['allowed_tags'];
return HTMLRestrictions::fromString(implode(' ', $source_editing_allowed_tags));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.