Answer the question
In order to leave comments, you need to log in
Django way to replace quotes on encoding inside html content?
UPD the title has changed...
Способ замены <script></script> на <script></script>?
var quill = new Quill('#editor', {
theme: 'snow',
placeholder: 'Напишите что то...',
});
$(document).ready( function() {
var content = document.getElementById('id_content');
var qlEditor = document.getElementsByClassName('ql-editor');
if (content.value === '') {
// Ести поле textarea пустое, вставлет пробел
content.value = ' ';
} else {
// При редактировании поста вставляет html
// с textarea в quill редактор
$('.ql-editor').html(content.value);
}
});
// Передает html разметку с редактора в textarea
// при отправке формы
var form = document.querySelector('form');
form.onsubmit = function() {
var content = document.getElementById('id_content');
content.value = quill.root.innerHTML;
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question