即时使用quill.js“Quill Rich Text Editor”用于我的项目。 我想编程一个“代码”按钮,以设置特定的代码内容。复制/粘贴文本格式quill.js
但编辑器中的代码功能需要保留文本格式。 与HTML中的<pre>
标记一样。
但是,当我在编辑器中复制一些“代码”文本,制表符或多空间将被删除。 即使我向编辑器类添加“white-space:pre!important”。
.ql-editor {
box-sizing: border-box;
height: 300px;
min-height: 100%;
outline: none;
tab-size: 4;
white-space: pre !important;
}
有人有同样的问题,或任何人都知道这个问题的解决方案?
问候