diff --git a/deno.json b/deno.json index 8a234c7c..1ac127d0 100644 --- a/deno.json +++ b/deno.json @@ -4,6 +4,7 @@ "@std/assert": "jsr:@std/assert@^1.0.6", "@std/dotenv": "jsr:@std/dotenv@^0.225.2", "@std/fs": "jsr:@std/fs@^0.229.3", + "@std/html": "jsr:@std/html@^1.0.3", "@std/media-types": "jsr:@std/media-types@^1.0.3", "ga4": "https://raw.githubusercontent.com/denoland/ga4/04a1ce209116f158b5ef1658b957bdb109db68ed/mod.ts", "lume/": "https://deno.land/x/lume@v2.4.1/", diff --git a/deno.lock b/deno.lock index 5fe9bbd1..cca2aaad 100644 --- a/deno.lock +++ b/deno.lock @@ -2,6 +2,7 @@ "version": "4", "specifiers": { "jsr:@davidbonnet/astring@1.8.6": "1.8.6", + "jsr:@std/assert@^1.0.6": "1.0.8", "jsr:@std/cli@1.0.6": "1.0.6", "jsr:@std/cli@^1.0.6": "1.0.6", "jsr:@std/collections@^1.0.5": "1.0.9", @@ -18,7 +19,9 @@ "jsr:@std/fs@^1.0.4": "1.0.5", "jsr:@std/fs@~0.229.3": "0.229.3", "jsr:@std/html@1.0.3": "1.0.3", + "jsr:@std/html@^1.0.3": "1.0.3", "jsr:@std/http@1.0.9": "1.0.9", + "jsr:@std/internal@^1.0.5": "1.0.5", "jsr:@std/io@0.225": "0.225.0", "jsr:@std/json@1": "1.0.1", "jsr:@std/jsonc@1.0.1": "1.0.1", @@ -68,6 +71,12 @@ "@deno/gfm@0.8.2": { "integrity": "a7528367cbd954a2d0de316bd0097ee92f06d2cb66502c8574de133ed223424f" }, + "@std/assert@1.0.8": { + "integrity": "ebe0bd7eb488ee39686f77003992f389a06c3da1bbd8022184804852b2fa641b", + "dependencies": [ + "jsr:@std/internal" + ] + }, "@std/cli@1.0.6": { "integrity": "d22d8b38c66c666d7ad1f2a66c5b122da1704f985d3c47f01129f05abb6c5d3d" }, @@ -120,6 +129,9 @@ "jsr:@std/streams" ] }, + "@std/internal@1.0.5": { + "integrity": "54a546004f769c1ac9e025abd15a76b6671ddc9687e2313b67376125650dc7ba" + }, "@std/io@0.225.0": { "integrity": "c1db7c5e5a231629b32d64b9a53139445b2ca640d828c26bf23e1c55f8c079b3" }, @@ -1751,6 +1763,7 @@ "jsr:@std/assert@^1.0.6", "jsr:@std/dotenv@~0.225.2", "jsr:@std/fs@~0.229.3", + "jsr:@std/html@^1.0.3", "jsr:@std/media-types@^1.0.3", "npm:googleapis@144", "npm:tailwindcss@^3.4.9" diff --git a/reference.page.jsx b/reference.page.jsx index e13215e0..a81f1732 100644 --- a/reference.page.jsx +++ b/reference.page.jsx @@ -1,4 +1,6 @@ import { walkSync } from "@std/fs/walk"; +import { unescape } from "@std/html/entities"; +import entityList from "@std/html/named-entity-list.json" with { type: "json" }; export const layout = "raw.tsx"; @@ -24,7 +26,9 @@ export default function* () { let title = ""; try { const match = titleRegexp.exec(content); - title = match[1].slice(0, -"documentation".length) + "- Deno Docs"; + const titleFirst = match[1].slice(0, -"documentation".length); + + title = unescape(titleFirst, { entityList }) + "- Deno Docs"; } catch (e) { if (!file.path.endsWith("prototype.html")) { console.error(file.path);