Issue Bug Closed

#82476CKEditor removes classes from p and span since TYPO3 8.7.5

Michi Spandl 09/13/17, 15:24 updated 12/18/23, 12:36

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?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 12

  1. Grégory Duchesnes commented 09/19/17, 12:15

    have a look at #82374

  2. Florian Wessels commented and changed subject CKEditor removes classes from p and span since TYPO3 8.7.6 CKEditor removes classes from p and span since TYPO3 8.7.5 09/27/17, 10:35

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

  3. Michi Spandl commented 09/29/17, 07:45

    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. Anonymous commented 10/30/17, 10:51

    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. Jürg Blaser commented 04/06/18, 16:15

    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. Andrea Moroni commented 05/02/18, 17:55

    Still in Issue in TYPO3 8.7.13 :-(

  7. Markus Dübbert commented 06/14/18, 06:46

    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. Riccardo De Contardi commented 09/15/18, 23:27

    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. Markus Dübbert commented and changed TYPO3 Version 8 9 04/08/20, 19:20

    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. David Voigt commented 08/19/20, 10:58

    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 =
  11. Benni Mack commented and changed status New Needs Feedback 01/26/22, 08:16

    Hey everyone,

    just by reading, I think we have all the solutions by providing proper configuration to support this? Or would we need to change something in TYPO3 v10+?

  12. Christian Kuhn commented and changed status Needs Feedback Closed 12/18/23, 12:36

    Hey. I hope it’s ok to close here. Mainly due to lack of further feedback and with keeping in mind that v12 comes with a new ckeditor version that may have changed this area as well. Let’s re-open a fresh issue referencing this one in case this is still an issue.