0
votes

When I add html content to CKEditor (source-code mode) and then save the html content, some tags are removed - for example <strong> or <h4>.

I am using the default YAML Konfiguration and add my own one:

# 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

Furthermore I have the following TS page config (not sure if this is used by TYPO3 - it's a setup of the old RTE editor):

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
Can you check the list of tags on lib.parseFunc_RTE.allowTags ? - Riccardo De Contardi
Try to use this as an example: forge.typo3.org/issues/81014#note-1 - Aristeidis Karavas
Maybe 'format_tags: "p;h1;h2;h3;h4;h5;pre"' is missing? - Mario Wilhelm
allowTags has no affect. "format_tags" defines the list of available block formats in RTE, so this has no affect on the parser. The sample did not help me either. - Gerfried

1 Answers

2
votes

I finally found the solution, by comparing my Custom.yaml with typo3\sysext\rte_ckeditor\Configuration\RTE\Full.yaml

To allow more tags I had to add the new tags in the following sections of my Yaml file:

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

processing:
  allowTags:
    - link
    - strong
    - h4