@seafile/sdoc-editor 0.3.15 → 0.3.16
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.
|
@@ -218,14 +218,17 @@ export const getAboveBlockNode = (editor, options) => {
|
|
|
218
218
|
}));
|
|
219
219
|
};
|
|
220
220
|
export const getPrevNode = editor => {
|
|
221
|
-
const
|
|
221
|
+
const lowerNodeEntry = getAboveNode(editor, {
|
|
222
222
|
mode: 'lowest',
|
|
223
223
|
match: n => Element.isElement(n) && Editor.isBlock(editor, n)
|
|
224
224
|
});
|
|
225
|
-
const
|
|
225
|
+
const highNodeEntry = getAboveNode(editor, {
|
|
226
226
|
mode: 'highest',
|
|
227
227
|
match: n => Element.isElement(n) && Editor.isBlock(editor, n)
|
|
228
228
|
});
|
|
229
|
+
if (!lowerNodeEntry || !highNodeEntry) return null;
|
|
230
|
+
const [heightNode, heightPath] = highNodeEntry;
|
|
231
|
+
const [lowerNode, lowerPath] = lowerNodeEntry;
|
|
229
232
|
let prevNode = null;
|
|
230
233
|
try {
|
|
231
234
|
prevNode = Editor.previous(editor, {
|