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
12 changes: 12 additions & 0 deletions src/__tests__/rewriteDocLinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ describe("rewriteRelativeDocLinks", () => {
);
});

it("rewrites reference-style definitions without a title", () => {
expect(rewriteRelativeDocLinks("[id]: architecture.md", "hive")).toBe(
"[id]: /docs/hive/architecture"
);
});

it("leaves non-doc reference-style definitions unchanged", () => {
same("[ext]: https://example.com/page");
same("[abs]: /docs/hive/architecture");
same("[img]: diagram.png");
});

it("preserves CommonMark titles", () => {
expect(rewriteRelativeDocLinks('[x](x.md "Title")', "hive")).toBe(
'[x](/docs/hive/x "Title")'
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe("getProjectFromPath", () => {
["/docs/rationguard/install", "rationguard"],
["/docs/promptargs", "promptargs"],
["/docs/dibs", "dibs"],
["/docs/crux", "crux"],
["/docs/crux/getting-started", "crux"],
["/docs/spektacular/api", "spektacular"],
] as const)("maps %s to project %s", (pathname, id) => {
expect(getProjectFromPath(pathname).id).toBe(id);
Expand Down
Loading