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