Bug #14628
closedCSS Styled Contnent and linebreaks inserted by t3lib_parsehtml_proc
0%
Description
Method TS_transform_db of class t3lib_parsehtml_proc inserts supefluous linebreaks after tags PRE, UL, OL, H1, H2, H3, H4, H5, H6, TABLE and BLOCKQUOTE.
These get transforned in <p class="bodytext"> </p> by CSS Styled Content.
I don't know if the problem is in CSS Styled Content or in t3lib_parsehtml_proc, but, for the purposes of rtehtmlarea, I extended t3lib_parsehtml_proc replacing
$lastBR = $cc==$aC ? '' : chr(10);
with
$lastBR = ($css || $cc==$aC) ? '' : chr(10);
(issue imported from #M919)
Updated by Stanislas Rolland over 19 years ago
The above modification was removing to many linebreaks. The problem occurs only when the content element ends with one of the specified tags. The correction is then to add after:
$aC = count($blockSplit);
the following lines:
while($aC && !strcmp(trim($blockSplit[$aC-1]),'')) {
unset($blockSplit[$aC-1]);
$aC = count($blockSplit);
}
Perhaps removing just the last entry would be enough. In any case, the empty ending $blockSplit entry prevents the correct recognition of the tag as the last item of the content element.