From 3f8b65727014b701209fac9d86ce911779fff8d0 Mon Sep 17 00:00:00 2001 From: calcscout Date: Sat, 30 Apr 2022 13:23:48 +0200 Subject: [PATCH 1/2] HTML DOM parser skip links with inline javascript --- bits/79_html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bits/79_html.js b/bits/79_html.js index 76482ed..44c54be 100644 --- a/bits/79_html.js +++ b/bits/79_html.js @@ -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; -- 2.34.1 From 14697057a6a26e09bea79aa694cb8caeb5c36334 Mon Sep 17 00:00:00 2001 From: calcscout Date: Sat, 30 Apr 2022 13:41:03 +0200 Subject: [PATCH 2/2] HTML DOM parser skip links with inline javascript --- bits/79_html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bits/79_html.js b/bits/79_html.js index 44c54be..6fb0ed6 100644 --- a/bits/79_html.js +++ b/bits/79_html.js @@ -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; -} +} \ No newline at end of file -- 2.34.1