Project

General

Profile

Actions

Bug #103512

closed

div in ckeditor

Added by wini2 no-lastname-given 8 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2024-03-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As far as I understand it, div-Tags are allowed by default (https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/8.0/Breaking-72837-RTETransformationsAllowDivSectionsByDefaultAndRemoveFont-specificParsing.html#breaking-72837-rte-transformations-allow-div-sections-by-default-and-remove-font-specific-parsing).

My styles.content.allowTags are the default - also containing div

My processing.yaml contains

processing:
  mode: default
  # Tags that are allowed in the content in general
  allowTags: 
    ...
    div

and default transformation-settings.

Divs are also allowed in ckeditor by using htmlSupport - { name: 'div', attributes: true, classes: true, styles: true }

The div shows up in ckeditor until I press the save-button. After this, the div is stored in the database but replaced by p in ckeditor and rendered as p in FE.

Actions #1

Updated by Benni Mack 5 months ago

  • Status changed from New to Closed

This code is not replaced in RTE. This works as expected when using:

style:
definitions:
- { name: "Lead", element: "p", classes: ['lead'] }
- { name: "Small", element: "small", classes: [] }
- { name: "Muted", element: "span", classes: ['text-muted'] }
- { name: 'div', element: "div", attributes: true, classes: true, styles: true }

Please check your database contents (= what is in the DB table row).

In addition, you should check your "lib.parseFunc_RTE" configuration in Frontend output. There is a option called "remapTag.DIV = P" - this line needs to be unset.

Just use this in your TypoScript:

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.remapTag.DIV >

Actions

Also available in: Atom PDF