I am creating PHP source code, which inserts page I have created using quill text editor. Text editor data is inserting work, but not inserting plain text. I want to insert HTML plain text
Here is my JavaScript code
<script src="https://cdn.quilljs.com/1.2.3/quill.core.js"></script>
<script src="https://cdn.quilljs.com/1.2.3/quill.min.js"></script>
<script src="https://cdn.quilljs.com/1.2.2/quill.js"></script>
<!-- Initialize Quill editor -->
<script>
var quill = new Quill('#editor', {
modules: {
toolbar: [
['bold', 'italic'],
['link', 'blockquote', 'code-block', 'image'],
[{ list: 'ordered' }, { list: 'bullet' }]
]
},
placeholder: 'Compose an epic...',
theme: 'snow'
});
var form = document.querySelector('form');
form.onsubmit = function() {
// Populate hidden form on submit
var about = document.querySelector('input[name=content]');
about.value = JSON.stringify(quill.getContents());
};
</script>
Display like this results
{"ops":[{"insert":"yyyyyyyyyyyyyyyy"},{"attributes":{"code-block":true},"insert":"\n"}]}