HTML DOM parser skip links with inline javascript

This commit is contained in:
calcscout 2022-04-30 13:23:48 +02:00
parent 47eeaa367d
commit f38191d266

@ -187,7 +187,7 @@ function sheet_add_dom(ws/*:Worksheet*/, table/*:HTMLElement*/, _opts/*:?any*/)/
if(Aelts && Aelts.length) for(var Aelti = 0; Aelti < Aelts.length; ++Aelti) if(Aelts[Aelti].hasAttribute("href")) {
l = Aelts[Aelti].getAttribute("href"); if(l.charAt(0) != "#") break;
}
if(l && l.charAt(0) != "#") o.l = ({ Target: l });
if(l && l.charAt(0) != "#" && l.slice(0, 11).toLowerCase() != 'javascript:') o.l = ({ Target: l });
if(opts.dense) { if(!ws[R + or_R]) ws[R + or_R] = []; ws[R + or_R][C + or_C] = o; }
else ws[encode_cell({c:C + or_C, r:R + or_R})] = o;
if(range.e.c < C + or_C) range.e.c = C + or_C;
@ -227,4 +227,4 @@ function get_get_computed_style_function(element/*:HTMLElement*/)/*:?function*/
// If it is not available, try to get one from the global namespace
if(typeof getComputedStyle === 'function') return getComputedStyle;
return null;
}
}