Skip to content

Commit

Permalink
fix(path): correct handle URI schemes in joinSegments (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiami2012 authored Jan 1, 2025
1 parent a934397 commit 9466c14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion quartz/util/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ export function slugTag(tag: string) {
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[] {
Expand Down

0 comments on commit 9466c14

Please sign in to comment.