[TYPO3-english] Get rid of unwanted p-tags in RTE

Nicolai Schirawski ns at t3magic.de
Fri Oct 16 10:42:04 CEST 2015


Hi list,

I have added my own blockelement in RTE with the intention to get a <div
class="myClass"></div> around a selected line:

RTE.default.buttons.formatblock.addItems = myName
RTE.default.buttons.formatblock.items.myName.addClass = myClass
RTE.default.buttons.formatblock.items.myName.tagName = div
RTE.default.proc.allowedClasses := addToList(myClass)


Afterwards, I can apply my new style to a line. This gets correctly
stored in DB:

<div class="myClass">formatted Line</div>
unformatted text

But in FE this text gets displayed with unwanted p-tags around the
formatted line.

<div class="myClass"><p>formatted Line</p></div>
<p>unformatted text</p>

I tried to add "div" to the list of accepted encapsulating tags:

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList =
div,p,pre,h1,h2,h3,h4,h5,h6

According to documentation this should do the job, but in fact, it
didn't change the behavior.

Any idea how else to get rid of the p-tag?

Thanks for hints
Nicolai


More information about the TYPO3-english mailing list