Skip to content

Commit

Permalink
Fix relative links in patchouli conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Feb 26, 2025
1 parent fcd0897 commit 81d8571
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/src/components/patchouli/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ export function relativePageLink(pageId: string, targetPageId: string): string {
}
}

let result: string;
if (commonPrefix >= pageIdParts.length - 1) {
return "./" + targetPageParts.pop() + ".md";
result = "./" + targetPageParts.pop() + ".md";
} else {
result = "../".repeat(pageIdParts.length - 1 - commonPrefix) + targetPageParts.slice(commonPrefix).join("/") + ".md";
}

return "../".repeat(pageIdParts.length - 1 - commonPrefix) + targetPageParts.pop() + ".md";
return result;
}

export async function findRecipeResultItem(zipContent: ZipContent,
Expand Down

0 comments on commit 81d8571

Please sign in to comment.