我使用react-quill作为富文本编辑器。我需要插入一个已经存在的HTML代码,以便它将在编辑器中显示为文本。有没有能力做这样的事情?
let htmlSample = "<p>It's a test html <b>to be inserted!</b></p>
<ReactQuill htmlValue="{htmlSample}" />结果将如下所示:

发布于 2020-11-26 08:23:42
好的,我来吧。如果其他人想知道如何插入纯html -只需将您的自定义编辑器区域放在下面:
<ReactQuill value={this.state.value}>
<div class="your-custom-container">
<p>your custom html</p>
</div>
</ReactQuill>https://stackoverflow.com/questions/65013312
复制相似问题