@fibery/prosemirror-schema 4.4.2 → 4.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/nodes/code-block.js +0 -22
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.code_block = void 0;
|
|
4
|
-
const prosemirror_model_1 = require("prosemirror-model");
|
|
5
4
|
const getLanguageFromEditorStyle = (dom) => {
|
|
6
5
|
return dom.getAttribute("data-language") || undefined;
|
|
7
6
|
};
|
|
@@ -61,27 +60,6 @@ exports.code_block = {
|
|
|
61
60
|
return { language };
|
|
62
61
|
},
|
|
63
62
|
},
|
|
64
|
-
// Handle VSCode paste
|
|
65
|
-
{
|
|
66
|
-
tag: "div[style]",
|
|
67
|
-
preserveWhitespace: "full",
|
|
68
|
-
getAttrs: (domNode) => {
|
|
69
|
-
const dom = domNode;
|
|
70
|
-
if (dom.style.whiteSpace === "pre" ||
|
|
71
|
-
(dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf("monospace") > -1)) {
|
|
72
|
-
return {};
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
},
|
|
76
|
-
getContent: (domNode, schema) => {
|
|
77
|
-
const dom = domNode;
|
|
78
|
-
const code = Array.from(dom.children)
|
|
79
|
-
.map((child) => child.textContent)
|
|
80
|
-
.filter((x) => x !== undefined)
|
|
81
|
-
.join("\n");
|
|
82
|
-
return code ? prosemirror_model_1.Fragment.from(schema.text(code)) : prosemirror_model_1.Fragment.empty;
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
63
|
// Handle GitHub/Gist paste
|
|
86
64
|
{
|
|
87
65
|
tag: "table[style]",
|