1

我正在尝试删除<p><br></p>在使用 React Quill 时作为换行符出现的额外标签。我尝试实现此处matchVisual概述的参数,但它似乎仍然在输出中给了我那个段落和 br 标记。这是一个代码笔,显示了对 Quill 演示设置的简单更改,但它仍然无法正常工作。

我在构造函数中声明了 Quill 的模块,例如:

 constructor (props) {
    super(props)
    this.state = { editorHtml: '', theme: 'snow' }
    this.handleChange = this.handleChange.bind(this)
    this.modules = {
            toolbar: [
                [{ 'header': '1'}, {'header': '2'}],
                [{size: []}],
                ['bold', 'italic', 'underline', 'strike', 'blockquote'],
                [{'list': 'ordered'}, {'list': 'bullet'}, 
                {'indent': '-1'}, {'indent': '+1'}],
                [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }],
                ['link', 'image'],
                ['clean']
            ],
            clipboard: {
              matchVisual: false,
            }
          }
        
    this.formats = [
      'header', 'size',
      'bold', 'italic', 'underline', 'strike', 'blockquote',
      'list', 'bullet', 'indent',
      'link', 'image', 'align'
    ]
  }

我可能做错了一些事情;有任何想法吗?

4

1 回答 1

-1

问题是它matchVisual已作为选项被删除如GitHub 上的发行说明中所述,此更改发生在 Quill 2.0 中。

于 2020-04-19T17:56:58.103 回答