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

TYPO3:CKEditor删除一些html标记(例如,strong、h4),ckeditor,typo3,typo3-8.x,Ckeditor,Typo3,Typo3 8.x,当我将html内容添加到CKEditor(源代码模式)并保存html内容时,一些标记会被删除—例如或 我正在使用默认的YAML配置并添加我自己的配置: # EXT:my_ext/Configuration/RTE/Default.yaml imports: # Import default RTE config (for example) - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" } - {

当我将html内容添加到CKEditor(源代码模式)并保存html内容时,一些标记会被删除—例如

我正在使用默认的YAML配置并添加我自己的配置:

# 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编辑器的设置):


通过比较Custom.yaml和typo3\sysext\rte\u ckeditor\Configuration\rte\Full.yaml,我终于找到了解决方案

为了允许更多标记,我必须在Yaml文件的以下部分添加新标记:

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

processing:
  allowTags:
    - link
    - strong
    - h4

通过比较Custom.yaml和typo3\sysext\rte\u ckeditor\Configuration\rte\Full.yaml,我终于找到了解决方案

为了允许更多标记,我必须在Yaml文件的以下部分添加新标记:

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

processing:
  allowTags:
    - link
    - strong
    - h4

你能检查一下
lib.parseFunc_RTE.allowTags
上的标签列表吗?试着用这个例子:可能“格式标签:”p;h1;h2;h3;h4;h5;pre“”缺失?allowTags没有影响。“format_tags”定义RTE中可用块格式的列表,因此这对解析器没有影响。这个示例对我也没有帮助。你能检查一下
lib.parseFunc_RTE.allowTags
上的标签列表吗?试着用这个例子:可能“format_标签:”p;h1;h2;h3;h4;h5;pre“”丢失了?allowTags没有影响。“format_tags”定义RTE中可用块格式的列表,因此这对解析器没有影响。这个示例对我也没有帮助。我喜欢文档中从未提到处理配置的方式。谢谢你救了我一个晚上!因此,您将config:allowTag放在processing.yaml和Custom.yaml(或full.yaml或base.yaml)中。因为我在processing.yaml中有allowTag,但在我的base中没有。yamlI只是将其添加到custom.yaml中,它将覆盖full.yaml以及processing.yamlI的设置,就像文档中从未提到处理配置一样。谢谢你救了我一个晚上!因此,您将config:allowTag放在processing.yaml和Custom.yaml(或full.yaml或base.yaml)中。因为我在processing.yaml中有allowTag,但在我的base中没有。yamlI刚刚将其添加到custom.yaml中,它将覆盖full.yaml和processing.yaml的设置