Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/remark-doc-usability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/docs-usability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down