你如何将 HTML 插入到 QuillJS 中? [英] How do you insert HTML into a QuillJS?

查看:162
本文介绍了你如何将 HTML 插入到 QuillJS 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将原始 HTML 插入到 Quill 中?我一直在搜索文档,但找不到任何内容.

如果不可能,我至少可以将 HTML 转换为 Quill Delta 吗?

我需要这个的原因是因为我正在抓取从 Quill 中获取的文本的原始 HTML,所以我可以稍后以 HTML 样式查看它.我做错了所有事情,还需要保留它的 Delta 版本吗?

解决方案

我找到了一种方法,非常仔细地查看文档.方法 quill.clipboard.dangerouslyPasteHTML('raw html'); 可以解决问题.https://quilljs.com/docs/modules/clipboard/#dangerouslypastehtml>

Is it possible to insert raw HTML into a Quill? I've been searching the documentation but couldn't find anything.

If it's not possible, can I at least convert HTML into a Quill Delta?

The reason I need this is because I am grabbing the raw HTML of the text taken from Quill, so I can view it later in HTML style. Have I been doing everything wrong, and need to keep a Delta version of it as well?

解决方案

I have found a way, looking extremely closely at the documentation. Method quill.clipboard.dangerouslyPasteHTML('raw html'); does the trick. https://quilljs.com/docs/modules/clipboard/#dangerouslypastehtml

这篇关于你如何将 HTML 插入到 QuillJS 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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