You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatHTML function in quill.htmlEditButton.js is doing a good job of beautifying the raw HTML.
However for me when there is a list in the editor contents the leading whitespace before the <li> tag is causing the editor to lose the list when the OK button is clicked.
A solution that works for me is to remove newlines and trim each of the lines before joining them back together.
So I changed this const noNewlines = textArea.value.replace(/\r?\n/g, ''); quill.container.querySelector(".ql-editor").innerHTML = noNewlines;
The formatHTML function in quill.htmlEditButton.js is doing a good job of beautifying the raw HTML.
However for me when there is a list in the editor contents the leading whitespace before the
<li>
tag is causing the editor to lose the list when the OK button is clicked.A solution that works for me is to remove newlines and trim each of the lines before joining them back together.
So I changed this
const noNewlines = textArea.value.replace(/\r?\n/g, ''); quill.container.querySelector(".ql-editor").innerHTML = noNewlines;
with this
const output = textArea.value.split(/\r?\n/g).map(el => el.trim()); quill.container.querySelector(".ql-editor").innerHTML = output.join('');
The text was updated successfully, but these errors were encountered: