forked from codex-team/editor.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_parser.js
More file actions
30 lines (26 loc) · 673 Bytes
/
_parser.js
File metadata and controls
30 lines (26 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Codex Editor Parser Module
*
* @author Codex Team
* @version 1.1
*/
module.exports = (function (parser) {
let editor = codex.editor;
/** inserting text */
parser.insertPastedContent = function (blockType, tag) {
editor.content.insertBlock({
type : blockType.type,
block : blockType.render({
text : tag.innerHTML
})
});
};
/**
* Check DOM node for display style: separated block or child-view
*/
parser.isFirstLevelBlock = function (node) {
return node.nodeType == editor.core.nodeTypes.TAG &&
node.classList.contains(editor.ui.className.BLOCK_CLASSNAME);
};
return parser;
})({});