@wrongstack/tools 0.10.2 → 0.10.3

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.
package/dist/builtin.js CHANGED
@@ -3994,8 +3994,9 @@ function expandIPv6(addr) {
3994
3994
  return [...head, ...new Array(fill).fill(0), ...tail];
3995
3995
  }
3996
3996
  function combineSignals(...sigs) {
3997
- if (typeof AbortSignal.any === "function") {
3998
- return AbortSignal.any(sigs);
3997
+ const anyFn = AbortSignal.any;
3998
+ if (typeof anyFn === "function") {
3999
+ return anyFn(sigs);
3999
4000
  }
4000
4001
  const ctrl = new AbortController();
4001
4002
  const cleanups = [];
@@ -4037,7 +4038,7 @@ function htmlToMarkdown(html) {
4037
4038
  s = s.replace(/<(strong|b)[^>]*>([\s\S]*?)<\/\1>/gi, "**$2**");
4038
4039
  s = s.replace(/<(em|i)[^>]*>([\s\S]*?)<\/\1>/gi, "*$2*");
4039
4040
  s = s.replace(/<a [^>]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi, (_m, href, text) => {
4040
- const safe = /^(https?|ftps?):\/\//i.test(href);
4041
+ const safe = /^(https?|ftps?):\/\//i.test(href) && !/^(javascript|data|vbscript):/i.test(href);
4041
4042
  return safe ? `[${text}](${href})` : text;
4042
4043
  });
4043
4044
  s = s.replace(/<pre[^>]*>([\s\S]*?)<\/pre>/gi, (_m, c) => "\n```\n" + stripTags(c) + "\n```\n");