TYPO3:CKEditor删除了一些html标签(例如,strong,h4)

时间:2018-12-22 11:23:28

标签: ckeditor typo3 typo3-8.x

当我将html内容添加到CKEditor(源代码模式),然后保存html内容时,将删除一些标签-例如<strong><h4>

我正在使用默认的YAML Konfiguration并添加自己的一个:

# EXT:my_ext/Configuration/RTE/Default.yaml
imports:
  # Import default RTE config (for example)
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Full.yaml" }
  # Import the image plugin configuration
  - { resource: "EXT:rte_ckeditor_image/Configuration/RTE/Plugin.yaml" }

editor:
  config:
    # RTE default config removes image plugin - restore it:
    removePlugins: null
    removeButtons: 
      - Anchor
    extraAllowedContent: 'a[onclick]'
    toolbarGroups:
      - { name: basicstyles, groups: [ basicstyles, align, cleanup ] }
      - { name: styles }
    stylesSet:
      - { name: "Rote Schrift", element: "span", attributes: { class: "highlighted red"} }
      - { name: "Button", element: "a", attributes: { class: "btn"} }
      - { name: "Checkliste", element: "ul", attributes: { class: "check-list"} }
    toolbarGroups:
      - { name: links, groups: ['MenuLink', 'Unlink', 'Anchor'] }
  externalPlugins:
      typo3image: { allowedExtensions: "jpg,jpeg,png,gif,svg" }
      typo3link: { resource: "EXT:rte_ckeditor/Resources/Public/JavaScript/Plugins/typo3link.js", route: "rteckeditor_wizard_browse_links" }

processing:
  HTMLparser_db: 
    denyTags: null

此外,我具有以下TS页面配置(不确定TYPO3是否使用了它-这是旧RTE编辑器的设置):

RTE.default.enableWordClean.HTMLparser {
    allowTags = a,b,blockquote,br,div,em,h2,h3,h4,h5,h6,hr,i,img,li,ol,p,span,strike,strong, ...

1 个答案:

答案 0 :(得分:0)

通过将我的Custom.yaml与typo3 \ sysext \ rte_ckeditor \ Configuration \ RTE \ Full.yaml进行比较,我终于找到了解决方案

要允许更多标签,我必须在Yaml文件的以下部分中添加新标签:

editor:
  config:
    allowTags:
      - link
      - strong
      - h4

processing:
  allowTags:
    - link
    - strong
    - h4