1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

TinyMce: Fixes an issue where additional line-breaks were being added when converting to HTML.

This commit is contained in:
Cameron
2016-01-24 20:08:47 -08:00
parent 6290a7c958
commit a00acf6319
2 changed files with 18 additions and 3 deletions

View File

@@ -798,7 +798,8 @@ class e_parse_shortcode
} }
$ret = preg_replace_callback('#\{(\S[^\x02]*?\S)\}#', array(&$this, 'doCode'), $text); $ret = preg_replace_callback('#\{([A-Z][^\x02]*?\S)\}#', array(&$this, 'doCode'), $text); // must always start with uppercase letter
// $ret = preg_replace_callback('#\{(\S[^\x02]*?\S)\}#', array(&$this, 'doCode'), $text);
$this->parseSCFiles = $saveParseSCFiles; // Restore previous value $this->parseSCFiles = $saveParseSCFiles; // Restore previous value
$this->addedCodes = $saveCodes; $this->addedCodes = $saveCodes;
$this->eVars = $saveVars; // restore eVars $this->eVars = $saveVars; // restore eVars
@@ -842,6 +843,7 @@ class e_parse_shortcode
return $matches[0]; return $matches[0];
} }
if(preg_match('/^([A-Z_]*):(.*)/', $matches[1], $newMatch)) if(preg_match('/^([A-Z_]*):(.*)/', $matches[1], $newMatch))
{ {
$fullShortcodeKey = $newMatch[0]; $fullShortcodeKey = $newMatch[0];

View File

@@ -41,11 +41,23 @@ class e107TinyMceParser
if(!empty($_GET['debug']) && getperms('0')) if(!empty($_GET['debug']) && getperms('0'))
{ {
$debug = true; // For future use. $debug = true; // For future use.
if(defined("TINYMCE_PARSER_DEBUG_TEXT"))
{
$text = TINYMCE_PARSER_DEBUG_TEXT;
echo "<h1>Original</h1>";
print_a($text);
echo "<h1>toHtml</h1>";
}
else
{
$text = <<<TEMPL $text = <<<TEMPL
[html][code]Something goes here [b]bold print[/b][/code][/html] [html][code]Something goes here [b]bold print[/b][/code][/html]
TEMPL; TEMPL;
}
$_POST['content'] = $text; $_POST['content'] = $text;
$_POST['mode'] = 'tohtml'; $_POST['mode'] = 'tohtml';
} }
@@ -68,6 +80,7 @@ TEMPL;
{ {
print_a($html); print_a($html);
echo "<hr />"; echo "<hr />";
echo "<h1>Rendered</h1>";
echo $html; echo $html;
} }
elseif($this->gzipCompression == true) elseif($this->gzipCompression == true)
@@ -104,8 +117,8 @@ TEMPL;
{ {
e107::getBB()->clearClass(); e107::getBB()->clearClass();
$content = str_replace('\r\n',"<br />",$content); //$content = str_replace('\r\n',"<br />",$content);
$content = nl2br($content, true); //$content = nl2br($content, true);
$content = $tp->toHtml($content, true); $content = $tp->toHtml($content, true);
} }