mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 20:20:21 +01:00
19 lines
397 B
JavaScript
19 lines
397 B
JavaScript
const TAGNAME = "PRE";
|
|
const state = {
|
|
activeBlock: null,
|
|
languages: [],
|
|
};
|
|
function createCodeBlock(content) {
|
|
const pre = document.createElement(TAGNAME);
|
|
pre.spellcheck = false;
|
|
pre.classList.add("hljs");
|
|
pre.innerHTML = content;
|
|
return pre;
|
|
}
|
|
|
|
function isCodeBlock(node) {
|
|
return node.nodeName === TAGNAME;
|
|
}
|
|
|
|
module.exports = { createCodeBlock, isCodeBlock, TAGNAME, state };
|