内联CKEditor在某些HTML标记中不起作用 [英] Inline CKEditor not working in some HTML tags
问题描述
CKEditor内联标准所有版本仅适用于少数HTML标记行< div>
,< p>
,< h1>
-< h6>
.此内联编辑器不会弹出诸如 strong
, i
, span
等之类的元素.
CKEditor Inline standard-all version works only with few HTML tags line <div>
, <p>
, <h1>
-<h6>
. This inline editor not popping up for elements like strong
, i
, span
, etc.
我正在grapesJS编辑器中使用此内联编辑器.
I am using this inline editor inside grapesJS editor.
这是 JSFiddle ,您可以在其中检查工作状态&代码.
Here is JSFiddle where you can check the working & code.
版本:
grapesjs-0.16.18
grapesjs - 0.16.18
ckeditor-标准版-4.14.1
我们可以使用 format_tags:"span; strong"
来解决此问题吗?还有其他方法可以解决此问题.请让我知道.
Can we able to fix this issue by using format_tags: "span;strong"
. Is there any other ways to fix this issue. Please let me know if any.
推荐答案
我得到的解决方案如下:
I got its solution as below:
CKEDITOR.dtd.$editable.span = 1
CKEDITOR.dtd.$editable.a = 1
CKEDITOR.dtd.$editable.strong = 1
CKEDITOR.dtd.$editable.em = 1
CKEDITOR.dtd.$editable.s = 1
CKEDITOR.dtd.$editable.u = 1
CKEDITOR.dtd.$editable.i = 1
CKEDITOR.dtd.$editable.p = 1
CKEDITOR.dtd.$editable.sub = 1
CKEDITOR.dtd.$editable.sup = 1
CKEDITOR.dtd.$editable.h1 = 1
CKEDITOR.dtd.$editable.h2 = 1
CKEDITOR.dtd.$editable.h3 = 1
CKEDITOR.dtd.$editable.h4 = 1
CKEDITOR.dtd.$editable.h5 = 1
CKEDITOR.disableAutoInline = true;
这不是核心文件更新或与之相关的东西.您可以在自定义/执行功能的地方添加此代码.
This not a core file update or something related to that. You can add this code in the place where you are customizing/doing your feature.
这是 JSFiddle ,您可以在其中检查工作状态&代码.
Here is JSFiddle where you can check the working & code.
这篇关于内联CKEditor在某些HTML标记中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!