javascript - Cckeditor 4.4.7 增强图像插件 : figcaption with tags

标签 javascript ckeditor

我想使用 p 和 span 标签来制作样式标题:

<figure>
    <img ... />
    <figcaption>
        <p><span class="styled">Caption1</span></p>
        <p>Caption2</p>
    </figcaption>
</figure>

如何做到这一点?

最佳答案

您可以在加载编辑器时更改增强图像标题的设置:

editor.on( 'pluginsLoaded', function() {
    editor.widgets.registered.image.editables.caption.allowedContent =
        'p; span(!styled)';
} );

此代码更改 nestedEditable.allowedContent设置为允许使用 styled 类的段落和跨度。

关于javascript - Cckeditor 4.4.7 增强图像插件 : figcaption with tags,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30548644/

相关文章:

javascript - 如何在ckeditor中实现保存按钮插件的ajax调用

ckeditor - Draft.js VS CKEditor?

javascript - 无法启用/禁用 html 表格行中的输入控件

javascript - 滚动事件上的 jQuery .addClass() 不起作用

javascript - 为什么我需要使用 setState 回调来设置依赖于第一个项目的 setState 完成的第二个状态项目的状态?

javascript - 如何使用ckeditor中的onKeyUp函数

javascript - 使用 Bash heredoc 在 Bash 终端中运行 ES6 代码

javascript - 将 javascript 变量嵌入到我的 html anchor href 中

javascript - CKEditor::通过自定义标签包裹内容

javascript - 如何在 React JS 中配置 Ckeditor 工具栏?