Skip to content
Snippets Groups Projects
Commit e3ecf23d authored by Gaus Surahman's avatar Gaus Surahman
Browse files

Issue #3427632 by Mortarion: Shortcode compatibility with CKeditor5

parent e25f4e09
No related branches found
No related tags found
No related merge requests found
Pipeline #119193 passed with warnings
Blazy 8.x-2.0-dev, 2024-03-14
------------------------------
- Issue #3427632 by Mortarion: Shortcode compatibility with CKeditor5.
Blazy 8.x-2.0-dev, 2024-03-09
------------------------------
- Issue #3424212: Performance issues with S3 (or other).
......
......@@ -33,9 +33,20 @@ class Shortcode {
// Might not be available with self-closing [TAG data="BLAH" /].
if (stristr($string, "[$item") !== FALSE) {
$string = self::process($string, $item);
// @todo remove into self::replace().
$string = str_replace("<p><$item ", "<$item ", $string);
$string = str_replace("<p><$item>\n", "<$item>", $string);
$string = str_replace("</$item></p>\n", "</$item>\n", $string);
}
return self::process($string, $container);
$text = self::process($string, $container);
// @todo remove into self::replace().
$text = str_replace("<p><$container ", "<$container ", $text);
$text = str_replace("<p><$container>\n", "<$container>\n", $text);
$text = str_replace("</$container></p>\n", "</$container>\n", $text);
return $text;
}
/**
......
......@@ -238,13 +238,14 @@ abstract class TextFilterBase extends FilterBase implements ContainerFactoryPlug
*
* See https://www.php.net/manual/en/class.domelement.php#101243
*/
protected function getHtml(\DOMElement $node): ?string {
protected function getHtml($node): ?string {
$text = '';
foreach ($node->childNodes as $child) {
if ($child instanceof \DOMElement) {
$text .= $child->ownerDocument->saveXML($child);
}
}
return $text;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment