Issue Bug Closed

#98933<figure> does not render correctly in frontend when a table is created in rte editor

Urs Maag 10/26/22, 14:09 updated 07/09/24, 12:46

Description

On inserting a table in backend’s rte editor, there is wrapping a
-tag around it. By rendering this in the frontend with fluid_styled_content (with f:format.raw), the figure tag is rendered with escaped signs (e.g. &lt; and &gt;). Additional, on every save in backend, there is inserted a new line below the
-tag.

I fixed the inserting new line every save in backend on adding the “figure”-tag on TYPO3\CMS\Core\Html\RteHtmlParser to the $blockElementList variable:

protected $blockElementList = 'DIV,TABLE,BLOCKQUOTE,PRE,UL,OL,H1,H2,H3,H4,H5,H6,ADDRESS,DL,DD,HEADER,SECTION,FOOTER,NAV,ARTICLE,ASIDE, FIGURE';
For correct rendering in frontend, i added the
-tag to the allowed tags in typoscript:
lib.parseFunc_RTE.allowTags:=addToList(figure)
lib.parseFunc_RTE.externalBlocks:=addToList(figure)
lib.parseFunc_RTE.externalBlocks.figure.stripNL = 1

Reviews 1