@blocknote/core 0.1.1 → 0.1.2
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://github.com/yousefed/blocknote",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.2",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"types",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"access": "public",
|
|
108
108
|
"registry": "https://registry.npmjs.org/"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "085650a27c92af2b54df6d8b0e73673180821ebe"
|
|
111
111
|
}
|
|
@@ -148,7 +148,9 @@ export const Block = Node.create<IBlock>({
|
|
|
148
148
|
renderHTML({ HTMLAttributes }) {
|
|
149
149
|
const attrs: Record<string, string> = {};
|
|
150
150
|
for (let [nodeAttr, HTMLAttr] of Object.entries(BlockAttributes)) {
|
|
151
|
-
|
|
151
|
+
if (HTMLAttributes[nodeAttr]) {
|
|
152
|
+
attrs[HTMLAttr] = HTMLAttributes[nodeAttr];
|
|
153
|
+
}
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
return [
|
|
@@ -62,17 +62,6 @@ const UniqueID = Extension.create({
|
|
|
62
62
|
attributes: {
|
|
63
63
|
[this.options.attributeName]: {
|
|
64
64
|
default: null,
|
|
65
|
-
parseHTML: (element) =>
|
|
66
|
-
element.getAttribute(`data-${this.options.attributeName}`),
|
|
67
|
-
renderHTML: (attributes) => {
|
|
68
|
-
if (!attributes[this.options.attributeName]) {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
[`data-${this.options.attributeName}`]:
|
|
73
|
-
attributes[this.options.attributeName],
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
65
|
},
|
|
77
66
|
},
|
|
78
67
|
},
|