Project

General

Profile

Actions

Bug #81014

closed

ckeditor removes <span>-tags inside <li>

Added by Stefan Neufeind almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2017-04-25
Due date:
% Done:

0%

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

Description

demo-source:
<ul class="unstyled ul-app ul-check">
<li><span class="icon-check"></span> demo1</li>
<li><span class="icon-check"></span> demo2</li>
</ul>

The spans with icon-check get removed.

I've also already searched for solutions. Some target using allowedContent - but our "extraAllowedContent"-setting should already allow quite some things. Even filling the spans with something does not seem to protect them from being removed.

When editing a record with a RTE-field containing the above mentioned HTML it gets loaded fine in the frame - but gets removed by ckeditor upon loading. switching to the source-view (without saving) does not show those spans anymore. Saving then proves the spans are also removed in the frontend.

Switching to the source-view and saving it's possible to add the above mentioned HTML - but opening the record and saving it again removes the spans.

Actions #1

Updated by Simon Ouellet almost 7 years ago

try this yaml config

editor:
  config:
    allowedContent : true
    extraAllowedContent : "span[!style]" 
    disallowedContent: "span[style]" 
    format_tags: p;h1;h2;h3;h4;h5;h6;div
    contentsCss: "path/to/rte.css" 

processing:
    HTMLparser_db:
      tags:
        span:
          allowedAttribs: class
          fixAttrib:
            style:
              unset : true
Actions #2

Updated by Mona Muzaffar almost 7 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Matthias Krappitz over 6 years ago

Had the same issue, tested this and it works. So +1 for closing this issue.

Actions #4

Updated by Stefan Neufeind over 6 years ago

  • Status changed from Needs Feedback to Closed

I couldn't yet retest this on the setup where I originally needed it. But let's close it for now, as per the other comments - okay.

Actions #5

Updated by Sybille Peters about 6 years ago

Is the proposed yaml really a good solution? Setting allowedContent to true will completely disable the filtering, which is not really recommended for security reasons (https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html).

Actions

Also available in: Atom PDF