mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: strip down pasted code blocks
This commit is contained in:
@@ -209,7 +209,18 @@ function TinyMCE(props) {
|
|||||||
browser_spellcheck: true,
|
browser_spellcheck: true,
|
||||||
inline: true,
|
inline: true,
|
||||||
fixed_toolbar_container: "#editorToolbar",
|
fixed_toolbar_container: "#editorToolbar",
|
||||||
autoresize_bottom_margin: 100,
|
paste_postprocess: function (_, args) {
|
||||||
|
const { node } = args;
|
||||||
|
if (node.childNodes) {
|
||||||
|
for (let childNode of node.childNodes) {
|
||||||
|
if (childNode.tagName === "PRE") {
|
||||||
|
childNode.className = "hljs";
|
||||||
|
const code = childNode.textContent || childNode.innerText;
|
||||||
|
childNode.innerHTML = code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
onBeforeExecCommand={async (command) => {
|
onBeforeExecCommand={async (command) => {
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in New Issue
Block a user