diff --git a/lib/remark-doc-usability.ts b/lib/remark-doc-usability.ts index 81ecb58b..ba2f448b 100644 --- a/lib/remark-doc-usability.ts +++ b/lib/remark-doc-usability.ts @@ -93,6 +93,10 @@ export function remarkDocUsability(indexes = loadCommandIndexes()) { } const visit = (node: Node) => { + // Tool docs name the site's own images by their full address so they show on GitHub too; here they load from + // this build, not from the deployed site. + if (node.type === "image" && node.url?.startsWith("https://wirecat.dev/")) + node.url = node.url.slice("https://wirecat.dev".length) if (node.type === "table") { tableNumber++ node.data = { diff --git a/scripts/docs-usability.test.ts b/scripts/docs-usability.test.ts index dc402b9e..1e304cf9 100644 --- a/scripts/docs-usability.test.ts +++ b/scripts/docs-usability.test.ts @@ -84,7 +84,7 @@ describe("documentation command references", () => { }) it("keeps browser-login screenshots in an accessible closed disclosure", () => { const tree = fromMarkdown( - "> **See the my.telegram.org login screen**\n>\n> ![Empty login form](/telegram-app-login.png)\n>\n> Website login comes before account authorization.\n", + "> **See the my.telegram.org login screen**\n>\n> ![Empty login form](https://wirecat.dev/telegram-app-login.png)\n>\n> Website login comes before account authorization.\n", ) remarkDocUsability(new Map())(tree, { path: "/project/content/docs/tg/sessions.md" }) expect(tree.children[0]).toMatchObject({