Ad

TYPO3 RTE List In List Weird Rendering

- 1 answer

I am using TYPO3 7.6 and I have created a simple text content element with the following html markup:

<ol>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World
    <ul>
        <li>Hello World</li>
        <li>Hello World</li>
        <li>Hello World</li>
    </ul>
  </li>
  <li>Hello World</li>
</ol>

As you can see I have created a nested list and it will be correctly saved, but if I inspect this nested list on frontend then I can see that TYPO3 do not render it correctly and adds empty p tags:

<ol>
  <p></p>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World</li>
  <li>Hello World
    <p></p>
    <ul>
        <li>Hello World</li>
        <li>Hello World</li>
        <li>Hello World</li>
    </ul>
    <p></p>
  </li>
  <li>Hello World</li>
  <p></p>
</ol>

How can I avoid this empty p tags?

Ad

Answer

Adding the following typoscript to my setup works for me :)

lib.parseFunc_RTE {
    externalBlocks {
        ol >
        ul >
        ol.stripNL = 1
        ol.stdWrap.parseFunc = < lib.parseFunc
        ul.stripNL = 1
        ul.stdWrap.parseFunc = < lib.parseFunc
    }
}
Ad
source: stackoverflow.com
Ad