@seafile/seafile-editor 1.0.9 → 1.0.10
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.
|
@@ -15,7 +15,11 @@ const tableRule = (element, parseChild) => {
|
|
|
15
15
|
if (nodeName === 'THEAD' || nodeName === 'TBODY') {
|
|
16
16
|
return parseChild(childNodes);
|
|
17
17
|
}
|
|
18
|
-
if (nodeName === 'TR') {
|
|
18
|
+
if (nodeName === 'TR' && childNodes.length > 0) {
|
|
19
|
+
// patch
|
|
20
|
+
const children = Array.from(childNodes);
|
|
21
|
+
const hasTdOrTh = children.some(item => item.nodeName === 'TH' || item.nodeName === 'TD');
|
|
22
|
+
if (!hasTdOrTh) return;
|
|
19
23
|
return {
|
|
20
24
|
id: slugid.nice(),
|
|
21
25
|
type: TABLE_ROW,
|
|
@@ -157,8 +157,11 @@ export const transformListItem = node => {
|
|
|
157
157
|
return transformCodeBlock(child);
|
|
158
158
|
} else if (child.type === 'list') {
|
|
159
159
|
return transformList(child);
|
|
160
|
+
} else if (child.type === 'html') {
|
|
161
|
+
// patch
|
|
162
|
+
return transformBlockHtml(child);
|
|
160
163
|
}
|
|
161
|
-
})
|
|
164
|
+
}).flat()
|
|
162
165
|
};
|
|
163
166
|
};
|
|
164
167
|
export const transformOrderedList = node => {
|