我的问题:Draftail还有可能吗?
我查看了文档 – 并成功为Draftail编写了自己的自定义函数,但它似乎只接受自定义按钮的HTML标记.
我看到Draftail将内容存储为JSON而不是HTML,因此可能会限制此功能.
解决方法 关于此主题有一个(已关闭)问题: https://github.com/springload/draftail/issues/156Unfortunately there is no such thing possible in this editor,since it doesn’t store its content as HTML. Having such a feature would also go the opposite way to the editor’s general direction – trying to enforce that end users can’t alter the content in unforeseen ways.
It would technically be possible to write a toolbar extension that takes the editor’s content,converts it to HTML,allows you to edit that,then inserts whatever was entered back into the editor – but again that completely defeats the purpose of using this editor to start with.
If you need such a feature,you’ll probably be better off using an editor like 07001 or 07002.
我想补充说,使用StreamFields可以更好地处理任何“复杂”的HTML结构.
总结以上是内存溢出为你收集整理的在Wagtail上向Draftail编辑器添加HTML查看全部内容,希望文章能够帮你解决在Wagtail上向Draftail编辑器添加HTML查看所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)