Merge branch 'jackyzha0:v4' into v4

This commit is contained in:
justin 2024-07-09 18:40:43 -04:00 committed by GitHub
commit f1e1384a59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 12 deletions

20
package-lock.json generated
View File

@ -55,7 +55,7 @@
"rfdc": "^1.3.1",
"rimraf": "^5.0.7",
"serve-handler": "^6.1.5",
"shiki": "^1.6.0",
"shiki": "^1.10.3",
"source-map-support": "^0.5.21",
"to-vfile": "^8.0.0",
"toml": "^3.0.0",
@ -820,9 +820,12 @@
}
},
"node_modules/@shikijs/core": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.6.0.tgz",
"integrity": "sha512-NIEAi5U5R7BLkbW1pG/ZKu3eb1lzc3/+jD0lFsuxMT7zjaf9bbNwdNyMr7zh/Zl8EXQtQ+MYBAt5G+JLu+5DlA=="
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.10.3.tgz",
"integrity": "sha512-D45PMaBaeDHxww+EkcDQtDAtzv00Gcsp72ukBtaLSmqRvh0WgGMq3Al0rl1QQBZfuneO75NXMIzEZGFitThWbg==",
"dependencies": {
"@types/hast": "^3.0.4"
}
},
"node_modules/@sindresorhus/merge-streams": {
"version": "2.3.0",
@ -5567,11 +5570,12 @@
}
},
"node_modules/shiki": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-1.6.0.tgz",
"integrity": "sha512-P31ROeXcVgW/k3Z+vUUErcxoTah7ZRaimctOpzGuqAntqnnSmx1HOsvnbAB8Z2qfXPRhw61yptAzCsuKOhTHwQ==",
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/shiki/-/shiki-1.10.3.tgz",
"integrity": "sha512-eneCLncGuvPdTutJuLyUGS8QNPAVFO5Trvld2wgEq1e002mwctAhJKeMGWtWVXOIEzmlcLRqcgPSorR6AVzOmQ==",
"dependencies": {
"@shikijs/core": "1.6.0"
"@shikijs/core": "1.10.3",
"@types/hast": "^3.0.4"
}
},
"node_modules/signal-exit": {

View File

@ -81,7 +81,7 @@
"rfdc": "^1.3.1",
"rimraf": "^5.0.7",
"serve-handler": "^6.1.5",
"shiki": "^1.6.0",
"shiki": "^1.10.3",
"source-map-support": "^0.5.21",
"to-vfile": "^8.0.0",
"toml": "^3.0.0",

View File

@ -3,7 +3,7 @@ import { normalizeRelativeURLs } from "../../util/path"
const p = new DOMParser()
async function mouseEnterHandler(
this: HTMLLinkElement,
this: HTMLAnchorElement,
{ clientX, clientY }: { clientX: number; clientY: number },
) {
const link = this
@ -33,7 +33,7 @@ async function mouseEnterHandler(
thisUrl.hash = ""
thisUrl.search = ""
const targetUrl = new URL(link.href)
const hash = targetUrl.hash
const hash = decodeURIComponent(targetUrl.hash)
targetUrl.hash = ""
targetUrl.search = ""
@ -100,7 +100,7 @@ async function mouseEnterHandler(
}
document.addEventListener("nav", () => {
const links = [...document.getElementsByClassName("internal")] as HTMLLinkElement[]
const links = [...document.getElementsByClassName("internal")] as HTMLAnchorElement[]
for (const link of links) {
link.addEventListener("mouseenter", mouseEnterHandler)
window.addCleanup(() => link.removeEventListener("mouseenter", mouseEnterHandler))