Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #N
Problem/Motivation
\Drupal\ckeditor\Plugin\CKEditorPlugin\Internal
is testing for some tags in
protected function generateFormatTagsSetting(Editor $editor) {
// The <p> tag is always allowed — HTML without <p> tags is nonsensical.
$format_tags = array('p');
// Given the list of possible format tags, automatically determine whether
// the current text format allows this tag, and thus whether it should show
// up in the "Format" dropdown.
$possible_format_tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre');
foreach ($possible_format_tags as $tag) {
$input = '<' . $tag . '>TEST</' . $tag . '>';
$output = trim(check_markup($input, $editor->format));
which calls (almost) all Filter plugins Filter::process().
This seems like a performance penalty esp. when Filter plugins have a complex setup.
Proposed resolution
Should protected function generateFormatTagsSetting(Editor $editor) {
use caching?
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#1 | core-ckeditor-cache-tags-2162685-1.patch | 815 bytes | clemens.tolboom |
Comments
Comment #1
clemens.tolboomComment #2
clemens.tolboomComment #3
Wim LeersGood catch! Agreed. Trivial fix. Thank you :)
Comment #4
webchickCommitted and pushed to 8.x. Thanks!