Why is React Quill matchVisuals not working?
See original GitHub issueI am trying to remove the extra <p><br></p>
tags that are present as line breaks while using React Quill. I tried implementing the matchVisual
parameter outlined here, but it still seems to be giving me that paragraph and br tags in the output. Here is a code pen showing simple changes to the Quill demo setup, and it still doesn’t work.
I declare the modules for Quill in the constructor like:
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'
]
}
I am probably doing something just a tad bit wrong, any ideas?
React-Quill version
- master (^1.3.3)
- 0.4.1
- 1.0.0-beta-1
- 1.0.0-beta-2
- 1.0.0-beta-3
- 1.0.0-beta-4
- 1.0.0-beta-5
- 1.0.0-rc-1
- 1.0.0-rc-2
- 1.0.0-rc-3
- 1.0.0
- 1.1.0
- Other (fork)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
matchVisual is not working in React Quill 2.0 - Stack Overflow
The problem is that matchVisual has been removed as an option. This change occurred with Quill 2.0, as noted in the release notes...
Read more >Why is React Quill matchVisuals not working? - Bountysource
I tried implementing the matchVisual parameter outlined here, but it still seems to be giving me that paragraph and br tags in the...
Read more >React-Quill matchVisual: false - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >react-quill - npm
Start using react-quill in your project by running `npm i react-quill`. ... We expect this release to be a drop-in upgrade – if...
Read more >Include functions in a plugin out of the constructor - React Studio
No problem with that, I just include the line like the next one inside ... getReactWebJSXCode = function(exporter) { var jsx = `<ReactQuill...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for sharing! I ended up just doing the following, before storing it in the database.
text.replace(/<p><br><\/p>/g, "")
I like your solution more, I might implement yours in the future haha!