mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
feat: add blockescape plugin for easy escaping
from block elements
This commit is contained in:
14
packages/tinymce-plugins/blockescape/index.js
Normal file
14
packages/tinymce-plugins/blockescape/index.js
Normal 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);
|
||||
})();
|
||||
Reference in New Issue
Block a user