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
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!