javascript - TYPO3:我的插件的 ckeditor 配置中标签的数据属性是条纹的
问题描述
我写了一个小插件给ckeditor添加一个按钮,这样用户就可以在编辑器中添加一个tooltip-codesnippet。这很完美。关闭对话框后,代码已正确插入。当我之后保存文本时,我的网站正在重新加载并且我的数据属性消失了。
在我的插件中,我添加了:
CKEDITOR.plugins.add('tooltip', {
lang: [ 'en', 'de'],
init: function (editor) {
editor.addCommand('tooltip', new CKEDITOR.dialogCommand('tooltip', {
allowedContent: 'span[data-hint-content]; sup'
}));
而且在我使用过的 yaml-config 中,我还添加了:
editor:
config:
allowedContent: 'span[data-*](*){*}; sup'
我在使用 8.x 版的 TYPO3 上下文中。
我已经尝试将 allowedContent 更改为 extraAllowedContent。但这无济于事。我注意到,我的 yaml-config 通过允许标签 span 或 sup 工作。但不能允许属性。还尝试使用 span[ ] oder span[data- ]。没有成功。
我在这里试过这个: TYPO3: CKEditor strips data-attributes in -Tags
有没有人有同样的问题?
解决方案
解决方法是修改 HTMLparser_db 的配置。只需将以下代码添加到 yaml-config 中:
processing:
HTMLparser_db:
tags:
span:
allowedAttribs: "class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop, data-target, data-toggle, data-hint-content"
推荐阅读
- bash - bash: /home/user/.bash_completion/alacritty: 没有这样的文件或目录
- python-3.x - Python。按日期过滤数组的最佳方法
- python - 从 S3 存储桶读取熊猫数据的最快选择?
- pytorch - 与 Pytorch 中从列表到张量的转换相关的错误
- powerbi - 是否可以在 Power BI 中创建此仪表板?
- c# - XmlDocument loping (foreach) reomving NameSpace "xmlns"
- python - 如何使用临时文件为 MySQL 数据加速 pandas read_sql?
- css - CSS 响应式图像“完全显示”屏幕上的无拉伸背景和精确的文本放置
- amazon-web-services - 未找到 CodeDeploy 到 ECS 容器名称,但配置似乎正确
- python - 如何从每个csv的列值中删除逗号然后合并?