Skip to content

Commit 482c8e6

Browse files
committed
add code formatting option to rich text editor toolbar
1 parent 8a25a90 commit 482c8e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/rich-text-editor/rich_text_editor.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function createAndReplaceTextarea(textarea) {
9595
function getMarkdownToolbarOptions() {
9696
return [
9797
[{ header: 1 }, { header: 2 }, { header: 3 }],
98-
["bold", "italic"],
98+
["bold", "italic", "code"],
9999
["link", "image", "blockquote", "code-block"],
100100
[{ list: "ordered" }, { list: "bullet" }],
101101
["clean"],
@@ -115,6 +115,11 @@ function initializeQuillEditor(editorDiv, toolbarOptions, initialValue) {
115115
modules: {
116116
toolbar: toolbarOptions,
117117
},
118+
formats: [
119+
'bold', 'italic', 'link',
120+
'header', 'list', 'blockquote',
121+
'code', 'code-block', 'image'
122+
],
118123
});
119124
if (initialValue) {
120125
quill.setText(initialValue);

0 commit comments

Comments
 (0)