moexiami
2025-01-01 9466c145b1b84299be5f865596b3ebdac248b9fa
fix(path): correct handle URI schemes in joinSegments (#1693)

1 files modified
7 ■■■■ changed files
quartz/util/path.ts 7 ●●●● patch | view | raw | blame | history
quartz/util/path.ts
@@ -185,8 +185,13 @@
export function joinSegments(...args: string[]): string {
  return args
    .filter((segment) => segment !== "")
    .map((segment, index) =>
      index === 0
        ? // Deduplicate but not remove leading slashes for first segment
          segment.replace(/\/+$/g, "").replace(/^\/\/+/g, "/")
        : segment.replace(/^\/+|\/+$/g, ""),
    )
    .join("/")
    .replace(/\/\/+/g, "/")
}
export function getAllSegmentPrefixes(tags: string): string[] {