admin管理员组文章数量:1207741
I'd like to know if it's possible and how to enable the CKEditor4 inline/contenteditable editing feature on <span>
and other inline elements. This is something which I cannot find in the official docs.
With this markup:
<span id="editable" contenteditable="true"></span>
And either the standard configuration (AutoInline enabled) or this configuration:
<script>
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline('editable'); // ID of the element to edit
</script>
An error is reported: The specified element mode is not supported on element: "span".
The same error is reported for <a>
tags.
I'd like to know if it's possible and how to enable the CKEditor4 inline/contenteditable editing feature on <span>
and other inline elements. This is something which I cannot find in the official docs.
With this markup:
<span id="editable" contenteditable="true"></span>
And either the standard configuration (AutoInline enabled) or this configuration:
<script>
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline('editable'); // ID of the element to edit
</script>
An error is reported: The specified element mode is not supported on element: "span".
The same error is reported for <a>
tags.
2 Answers
Reset to default 20Hack way to allow support for un supported tags:
CKEDITOR.dtd.$editable.span = 1
CKEDITOR.dtd.$editable.a = 1
Win.
Nope. It is not possible to create editor on inline elements. Here you can find list of accepted names.
However, I checked that after modifying that list I was able to initialize editor on strong
element and it even works... Unless you paste or do other unsupported action :).
本文标签: javascriptEnable CKEditor4 inline on span and other inline tagsStack Overflow
版权声明:本文标题:javascript - Enable CKEditor4 inline on span and other inline tags - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738736481a2109585.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论