feat: turn off spellcheck for inline-code

This commit is contained in:
thecodrr
2021-10-20 09:57:34 +05:00
parent d6e199a77e
commit 718be83e60
2 changed files with 3 additions and 17 deletions

View File

@@ -39,9 +39,10 @@ function toggleInlineCode(editor) {
const node = editor.selection.getNode();
if (node.tagName !== TAGNAME && range.startOffset === range.endOffset) {
editor.selection.setContent("<code>&#xFEFF;</code>");
editor.selection.setContent(`<code spellcheck="false">&#xFEFF;</code>`);
} else {
editor.execCommand("mceToggleFormat", false, "code");
const content = editor.selection.getContent();
editor.selection.setContent(`<code spellcheck="false">${content}</code>`);
}
});
}

View File

@@ -1,15 +0,0 @@
.mce-content-body code[data-mce-selected="inline-boundary"] {
background-color: rgb(27 31 35 / 5%);
}
.mce-content-body code {
background-color: rgb(27 31 35 / 5%);
border: 1px solid var(--border);
border-radius: 5px;
}
code {
font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas, Liberation Mono,
Menlo, monospace !important;
font-size: 14px !important;
}