How to keep TYPO3's RTE from adding an empty line before <ul>s

2.1k views Asked by At

In TYPO3 4.5 as well as 6.1, whenever I add an unordered list element, RTEhtmlarera (or some of its many processing routines) will add an extra

<p>&nbsp;</p>

before the ul tag on saving the content element.

enter image description here

This happens only once, when the ul is inserted first. When the p tag is removed and the content element is saved again, it won't happen again.

How can this erroneous behaviour be removed?

3

There are 3 answers

3
ms as On

Hi try set encapsLines to zero..

Setup typoscript:

tt_content.stdWrap.dataWrap > 
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines >
1
Benjamin On

For me with 6.1 this worked:

lib.parseFunc_RTE {
    externalBlocks = table, blockquote, ol, ul, div, dl, address, hr
    externalBlocks {
        ol.stripNL=1
        ol.stdWrap.parseFunc = < lib.parseFunc

        ul.stripNL=1
        ul.stdWrap.parseFunc = < lib.parseFunc

        # i have also seen this setting, but didnĀ“t test it:
        # blockquote.stripNLprev = 1 
        # blockquote.stripNLnext = 1
    }
}

I removed many lines for this example, be aware that you overwrite previous settings by using {} ..

1
Jan On

Not a real solution but maybe a hint in the right direction. If you write down your list, do not press enter before the first list entry but shift+enter. Example:

Here comes the list: <<-- AT THIS POINT PRESS SHIFT+ENTER
- a <<-- Here it does not matter if you press enter or shift+enter
- b
- c
- ...

This works for me as a workaround. I've done a lot of research in sysext:rtehtmlarea but nothing worked. So this looks for me like some kind of mysterious bug/feature connected with the "BR to P" (or vice versa) configuration you can define in pageTS or Setup. BTW: I never fully understood this conversion-thing :)