Bug #82476

CKEditor removes classes from p and span since TYPO3 8.7.5

Added by Michi Spandl about 3 years ago. Updated 3 months ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2017-09-13
Due date:
% Done:

0%

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

Description

Since I have updatet to TYPO3 8.7.6 the CKEditor removes all classes from p and span Tags on saving in the Backend.
It's still possible to have classes in a-Tags and Headlines (h2,h3,...). If I downgrade to 8.7.4 it is working again!
Is someone experiencing the same issue?

#1

Updated by Grégory Duchesnes about 3 years ago

have a look at #82374

#2

Updated by Florian Wessels about 3 years ago

  • Subject changed from CKEditor removes classes from p and span since TYPO3 8.7.6 to CKEditor removes classes from p and span since TYPO3 8.7.5

I can confirm that issue.
Not working in 8.7.5, too.
Downgrade works fine...

#3

Updated by Michi Spandl about 3 years ago

Still not working for me in 8.7.7 - but Grégory Duchesnes is right in #82374, an obsolete RTE.default.proc.allowedClasses := addToList(class-abc,class-xyz) solves the problem!

#4

Updated by Frederik Holz about 3 years ago

Confirm that this is still an issue on 8.7.8

Running RTE with a yaml config, without any other RTE typoscript (except RTE.default.preset) does not save any classes on p - Tags
Using RTE.default.proc.allowedClasses := addToList(class-abc,class-xyz) resolves the problem

#5

Updated by Jürg Blaser over 2 years ago

Frederik Holz wrote:

Confirm that this is still an issue on 8.7.8

Running RTE with a yaml config, without any other RTE typoscript (except RTE.default.preset) does not save any classes on p - Tags
Using RTE.default.proc.allowedClasses := addToList(class-abc,class-xyz) resolves the problem

Confirm that this is still an issue on 8.7.11
DELETE all RTE ... allowedClasses (on page-TSconfig) resolves the problem

#6

Updated by Andrea Moroni over 2 years ago

Still in Issue in TYPO3 8.7.13 :-(

#7

Updated by Markus Dübbert over 2 years ago

CK Editor again looses span and p classes in TYPO3 8.7.16
I'm not completely sure, but i think in 8.7.15 it worked.

#8

Updated by Riccardo De Contardi about 2 years ago

I've performed the following tests using TYPO3 8.7.19 (fresh installation)

- I am using standard CKEditor configuration
- Info > page TSConfig shows as configuration just

RTE
   [default]
      [preset] = default

Test 1

I've created a text element and write in it (using the source code)

<p class="test test2">TEST TEST TEST TEST <span class="test3 test4">TEST TEST</span></p>

RESULTS: the p tag and its classes are kept, but the span tag has been stripped.

Test 2

Modified the CKEditor configuration in this way:

editor:
  config: 
    extraAllowedContent: "span"  

RESULTS: span tag is still absent, also p classes are stripped away, too.

Test 3

The only configuration that seems to work is:

editor:
  config: 
    extraAllowedContent: "p(*);span(*)" 

This will allow the span tag to be kept, and preserves any class attribute on both p and span

#9

Updated by Markus Dübbert 8 months ago

  • TYPO3 Version changed from 8 to 9

For me in TYPO3 9 this is still the solution:
RTE.default.proc.allowedClasses := addToList(class-abc,class-xyz)

Only needed for p or span classes.

#10

Updated by David Voigt 3 months ago

Still loses span and p classes with a default config in 8.7.32.
Justify classes are even included in the Default.yaml that is being shipped with the ext.

Edit: in my case, the problem was a legacy parseFunc_RTE directive that messed with p classes. Remember when all p were classed with class="bodytext"?

# remove class 'bodytext' from RTE-p-tags
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.addAttributes.P.class =

Also available in: Atom PDF