I recently integrated Quill JS editor into my website. During testing, I noticed that any text inputted after a white space gets emitted when alerting the content.
Below is the HTML code snippet:
<div id="postCommentEditor" class="postCommentEditor ql-align-right ql-direction-rtl"></div>
For the JavaScript part:
const quillEditor = new Quill('#postCommentEditor', {
modules: {
toolbar: true,
},
theme: 'snow',
});
quillEditor.format('direction', 'rtl');
quillEditor.format('align', 'right');
And here's the CSS style for the post editor:
.postCommentEditor {
height: 100px;
margin-bottom: 5px;
}
When attempting to alert the input in the editor:
let $contentOBJ = $(quillEditor.root).children()[0].innerHTML;
alert($contentOBJ);
Typing:
aaaa
test
Results in only aaaa
being displayed in the alert message.