在span和其他内联标记上启用CKEditor4内联 [英] Enable CKEditor4 inline on span and other inline tags

查看:1011
本文介绍了在span和其他内联标记上启用CKEditor4内联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

有了这个标记:

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

并且标准配置(启用AutoInline)或此配置:

And either the standard configuration (AutoInline enabled) or this configuration:

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

报告错误:元素上不支持指定的元素模式: span。
< a> 标记报告同样的错误。

An error is reported: The specified element mode is not supported on element: "span". The same error is reported for <a> tags.

推荐答案

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

Hack way to allow support for un supported tags:

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

Win。

这篇关于在span和其他内联标记上启用CKEditor4内联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆