dependabot[bot]
2024-07-19 5fcba1bfaf8821fbb01cc7e67e01c553ffebfa39
quartz/components/scripts/spa.inline.ts
@@ -39,6 +39,9 @@
  document.dispatchEvent(event)
}
const cleanupFns: Set<(...args: any[]) => void> = new Set()
window.addCleanup = (fn) => cleanupFns.add(fn)
let p: DOMParser
async function navigate(url: URL, isBack: boolean = false) {
  p = p || new DOMParser()
@@ -57,6 +60,10 @@
  if (!contents) return
  // cleanup old
  cleanupFns.forEach((fn) => fn())
  cleanupFns.clear()
  const html = p.parseFromString(contents, "text/html")
  normalizeRelativeURLs(html, url)