[TYPO3-RTE] htmlarea
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon Jul 7 13:24:00 CEST 2008
Stefano Kowalke wrote: on 05.07.2008 20:16:
> Hi,
>
> the whole day i searching for a solution for this problem:
>
> RTE/TYPO3 transform the HTML sourcecode which i entered in the editor on the
> way to the DB and back to BE/FE.
>
> I put this (valid XHTML 1.0) code into the RTE:
>
> ...
> <div class="vcard">
> <h3 class="title">Title</h3>
> <span class="fn">Givenname Name</span>
> <div class="adr">
> <div class="street-address">Street</div>
> <span class="postal-code">03145</span>
> <span class="locality">City</span><br />
> <div class="country-name">Country</div>
> </div>
> <div class="tel">Phone</div>
> </div>.
> ...
>
>
>
> After saving the page, i got this code back:
>
> <div class="vcard"><h3 id="julia_siegel" class="title">Title</h3>
> <p> <span class="fn">Givenname Name</span> </p>
> <div class="adr"><div class="street-address"><p>Street</p></div>
> <p> <span class="postal-code">03145</span>
> <span class="locality">City</span><br /> </p>
> <div class="country-name"><p>Country</p></div></div>
> <div class="tel"><p>Phone</p></div>
> </div>
>
> In his endless wisdom RTE/TYPO3 put a <p>-tag pair around every <span>-tag
> and plain text if this between <div> like <div
> class="country-name"><p>Country</p></div>.
>
> I thought this transformation should help to write valid code, but this
> annoy me.
>
> Can somebody give me a hint how i can switch off inserting the <p> tags.
The default parseFunc_RTE does that, because every line which is not
already a "block" (<p>, <div>, etc) will be made into a <p>. This comes
from the fact that if you edit only without RTE (default some years
ago), you could make paragraphs by just hitting "enter" (new-line).
The transformation is not between RTE and DB but between the DB and the
frontend. I guess RTE is saving your data as you want it to.
If you want the <span> also to be handled like the P and DIV (as a block
tag), try:
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList :=
addToList(span)
Cheers,
Ernesto
More information about the TYPO3-project-rte
mailing list