TYPO3: CKEditor strips data-attributes in <span>-Tags

百般思念 提交于 2019-12-06 09:06:40

问题


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:


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[*]


来源:https://stackoverflow.com/questions/55041254/typo3-ckeditor-strips-data-attributes-in-span-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!