启用CKEditor4内联跨度和其他内联标记(Enable CKEditor4 inline on span and other inline tags)

编程入门 行业动态 更新时间:2024-10-25 13:23:15
启用CKEditor4内联跨度和其他内联标记(Enable CKEditor4 inline on span and other inline tags)

我想知道是否有可能以及如何在<span>和其他内联元素上启用CKEditor4内联/可控编辑功能。 这是我在官方文档中找不到的。

有了这个标记:

<span id="editable" contenteditable="true"></span>

无论是标准配置(AutoInline启用)还是此配置:

<script> CKEDITOR.disableAutoInline = true; CKEDITOR.inline('editable'); // ID of the element to edit </script>

报告错误: The specified element mode is not supported on element: "span". 对<a>标签报告相同的错误。

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.

最满意答案

Hack方式允许支持不支持的标签:

CKEDITOR.dtd.$editable.span = 1 CKEDITOR.dtd.$editable.a = 1

赢得。

Hack way to allow support for un supported tags:

CKEDITOR.dtd.$editable.span = 1 CKEDITOR.dtd.$editable.a = 1

Win.

更多推荐

本文发布于:2023-07-16 07:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125517.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内联   跨度   标记   tags   span

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!