【发布时间】:2023-03-17 03:25:01
【问题描述】:
你知道富文本编辑器吗?请访问medium.com,我希望你会被这个最漂亮的文本编辑器所启发,我想在我的django博客中集成这种类型的编辑器,用户可以在那里写他们的文章,我该如何集成呢?我现在使用 TinyMce 编辑器,但体验不是更好。还记得有件事告诉我,如果用户将图像上传到哪里,图像将保存在哪里?
我的 TinyMce 代码
<script
src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"
referrerpolicy="origin"
></script>
<script>
tinymce.init({
selector: "textarea#mytextarea",
/* plugins are the things which i can use in toolbar, menubar etc */
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'table emoticons template paste help imagetools'
],
toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | ' +
'bullist numlist outdent indent | link image | print preview media fullpage | ' +
'forecolor backcolor emoticons | help',
menu: {
favs: {title: 'My Favorites', items: 'code visualaid | searchreplace | emoticons'},
},
menubar: 'favs file edit view insert format tools table help',
)}
</script>
【问题讨论】:
标签: javascript django rich-text-editor