【发布时间】:2018-08-31 12:31:49
【问题描述】:
在普通的 TYPO3 8 安装中,我希望 ckeditor 允许源中的 img 标签,而不启用图像插件。 TYPO3中ckeditor的默认配置去掉了图片插件,导致img标签也被去掉了。
根据ckeditor文档,这可以通过属性来实现
config.extraAllowedContent = 'img'
但它在我的自定义 yaml 配置中不起作用。当我从源代码切换到所见即所得模式时,img 标签总是条带化。
如果我启用图像插件,则会保留 img 标签。但我不想把这个按钮作为选项提供给编辑。
我做错了什么?
这是我的测试 yaml 配置。底部是 extraAllowedContent 选项
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" }
editor:
config:
contentsCss: ["EXT:rte_ckeditor/Resources/Public/Css/contents.css", "EXT:tucmmforumhook/Resources/Public/Styles/Tucmain.css"]
stylesSet:
- { name: "XYZ Text", element: "span", attributes: { class: "highlighted red"} }
- { name: "Button", element: "a", attributes: { class: "button"} }
- { name: "Checklist", element: "ul", attributes: { class: "check-list"} }
format_tags: "p;h2;h3;h4;h5"
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 ] }
- { name: document, groups: [ mode ] }
justifyClasses:
- text-left
- text-center
- text-right
- text-justify
extraPlugins:
- justify
removePlugins:
- image
removeButtons:
- Strike
- Anchor
- Outdent
- Indent
- Blockquote
- JustifyBlock
extraAllowedContent:
- img
【问题讨论】: