1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +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->addedCodes = $saveCodes;
$this->eVars = $saveVars; // restore eVars
@ -842,6 +843,7 @@ class e_parse_shortcode
return $matches[0];
}
if(preg_match('/^([A-Z_]*):(.*)/', $matches[1], $newMatch))
{
$fullShortcodeKey = $newMatch[0];

View File

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