3
votes

I want to use a data-attribute in a span-Tag. The CKEditor removes this attribute.

If I add it in a p-Tag it will not removed and this is OK.

processing:
 allowAttributes: [data-count]

is added in the YAML-file.

I've tried this and other combinations, nothing works.

config
  extraAllowedContent: '*(*)[data-*]'

What do I have to do, to keep the data-attribute in a span-Tag?

1
did you find a solution? Got the same Problem. My questionswiener
Sorry, still no solution.Mario Wilhelm

1 Answers

2
votes

I have done this for iframe tag with attribbuts, no allowAttributes used for this:

processing:
  allowTags:
    - iframe

editor:
  config:    
    extraAllowedContent:
      - iframe[*]

for you this should do the trick:

editor:
  config:    
    extraAllowedContent:
      - span[*]