handle parsing context exception (#877)
This commit is contained in:
@@ -1256,9 +1256,23 @@ function buildElementTree(starter = document.body, frame, full_tree = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let ctxList = [];
|
let ctxList = [];
|
||||||
ctxList = getContextByLinked(element, ctxList);
|
try {
|
||||||
ctxList = getContextByParent(element, ctxList);
|
ctxList = getContextByLinked(element, ctxList);
|
||||||
ctxList = getContextByTable(element, ctxList);
|
} catch (e) {
|
||||||
|
console.error("failed to get context by linked: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ctxList = getContextByParent(element, ctxList);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("failed to get context by parent: ", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ctxList = getContextByTable(element, ctxList);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("failed to get context by table: ", e);
|
||||||
|
}
|
||||||
const context = ctxList.join(";");
|
const context = ctxList.join(";");
|
||||||
if (context && context.length <= 5000) {
|
if (context && context.length <= 5000) {
|
||||||
element.context = context;
|
element.context = context;
|
||||||
|
|||||||
Reference in New Issue
Block a user