mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 03:05:26 +02:00
Fix issue processwire/processwire-issues#1751
This commit is contained in:
@@ -286,9 +286,9 @@ class InputfieldTinyMCE extends InputfieldTextarea implements ConfigurableModule
|
||||
'styleFormatsCSS' => '',
|
||||
'extPlugins' => array(),
|
||||
'toggles' => array(
|
||||
self::toggleCleanDiv,
|
||||
self::toggleCleanNbsp,
|
||||
self::toggleCleanP,
|
||||
// self::toggleCleanDiv,
|
||||
// self::toggleCleanNbsp,
|
||||
// self::toggleCleanP,
|
||||
),
|
||||
);
|
||||
|
||||
|
@@ -163,7 +163,7 @@ class InputfieldTinyMCETools extends InputfieldTinyMCEClass {
|
||||
$toggles = $this->inputfield->toggles;
|
||||
if(!is_array($toggles)) return $value;
|
||||
|
||||
if(in_array(InputfieldTinyMCE::toggleCleanDiv, $toggles) === false && strpos($value, '<div') !== false) {
|
||||
if(in_array(InputfieldTinyMCE::toggleCleanDiv, $toggles) && strpos($value, '<div') !== false) {
|
||||
$value = preg_replace('{\s*(</?)div[^><]*>\s*}is', '$1' . 'p>', $value);
|
||||
while(strpos($value, '<p><p>') !== false) {
|
||||
$value = str_replace(array('<p><p>', '</p></p>'), array('<p>', '</p>'), $value);
|
||||
|
Reference in New Issue
Block a user