CKEditor始终将p标签包装在iframe周围

时间:2019-12-13 17:49:10

标签: iframe ckeditor typo3-9.x

我尝试增加在TYPO3 RTE CKEditor中允许iframe的可能性。我发现标记并没有立即被CKEditor或TYPO3的DB解析器杀死。

但是CKEditor 始终总是在iframe周围包装p标签,这显然是不正确的。我到处搜索过,尝试过不同的设置或它们的组合都没有成功。

一旦我添加了iframe代码(无论是直接在源代码模式下还是通过iframe插件都没关系),它就会立即包装在p标签中。因此,在TYPO3中绝对没有解析错误,因为这一切都发生在编辑器本身中。

有什么建议吗?这是我当前用于RTE的YAML配置。

# Load default processing options
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }

# Add configuration for the editor
# For complete documentation see http://docs.ckeditor.com/#!/api/CKEDITOR.config
editor:
  config:

    format_tags: "p;h1;h2;h3;h4;h5;pre"

    toolbarGroups:
      - { name: styles, groups: [ styles, format ] }
      - { name: basicstyles, groups: [ basicstyles ] }
      - { name: paragraph, groups: [ list, indent, blocks, align ] }
      - { name: links, groups: [ links ] }
      - { name: clipboard, groups: [ clipboard, cleanup, undo ] }
      - { name: editing, groups: [ spellchecker ] }
      - { name: insert, groups: [ insert ] }
      - { name: tools, groups: [ table, specialchar, insertcharacters ] }
      - { name: document, groups: [ mode ] }

    justifyClasses:
      - text-left
      - text-center
      - text-right
      - text-justify

    extraPlugins:
      - justify
      - autolink

    removePlugins:
      - image

    removeButtons:
      - Anchor
      - Underline
      - Strike
      - Styles

    allowTags:
      - iframe

    allowTagsOutside:
      - iframe

    extraAllowedContent:
      - 'iframe(*){*}[*];'

processing:
  allowTags:
    - iframe

  allowTagsOutside:
    - iframe

1 个答案:

答案 0 :(得分:1)

我认为您的问题是rte.ts中的旧配置仍然被加载。我将此添加到了default.yaml:

editor:
    processing:
        allowTags:
            - s
            - span
            - iframe
            - i
    HTMLparser_db:
        tags:
        span:
        rmTagIfNoAttrib: false

config:

    allowedContent: true
    removeFormatAttributes: ""

    extraAllowedContent:
        - span
        - iframe

并将其添加到我的page.ts

RTE.default.proc.blockElementList = PRE,UL,OL,H1,H2,H3,H4,H5,H6,ADDRESS,DL,DD,HEADER,SECTION,FOOTER,NAV,ARTICLE,ASIDE,IFRAME

希望这对您有帮助

相关问题