feat: add blockescape plugin for easy escaping

from block elements
This commit is contained in:
thecodrr
2021-10-16 10:28:05 +05:00
parent f9895f2749
commit 553938e2ab

View File

@@ -0,0 +1,14 @@
const { addPluginToPluginManager } = require("../utils");
function register(editor) {
editor.on("NewBlock", (e) => {
const element = e.newBlock;
if (element && element.parentElement.tagName === "BLOCKQUOTE") {
editor.execCommand("mceToggleFormat", false, "blockquote");
}
});
}
(function init() {
addPluginToPluginManager("blockescape", register);
})();