如何将一个模型属性转换为ckeditor5中的另一个模型属性?
我正在设置提及插件,并希望它的行为能力,以便插入(从下拉菜单中)插入带有链接的文本,即使您编辑文本,该链接仍然保留。
默认情况下,如果您编辑提及的文本,则CKEditor删除了提及/链接。
我对这样做的最佳方法的猜测是将模型中的属性转换为linkhref
属性。有办法这样做吗?
我知道升起和降低转换,但是修改这些转换并不能做我想要的。看来我们确实需要修改模型。
(在中评论第61和63行[提到的> JS] [1]
实际上可以防止不希望的行为,但这似乎不是解决问题的理想解决方案。)
I'm setting up the Mentions plugin and want it to behave such that inserting a Mention (from the dropdown menu) inserts text with a link, and that link remains even if you edit the text.
By default, if you edit the text of the mention, ckEditor removes the mention/link.
My guess of the best way to do this is to convert the Mention
attribute in the Model to a linkHref
attribute. Is there a way to do this?
I'm aware of upcast and downcast conversion, but modifying these doesn't do what I want. It seems we really need a modification of a model.
(Commenting out lines 61 and 63 in [mentionediting.js][1]
can actually prevent the undesired behavior, but this doesn't seem like the ideal solution to the problem.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论