mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
fix: sluggify pound (closes #681)
This commit is contained in:
parent
0a8c38dc21
commit
6babb788ed
2 changed files with 5 additions and 1 deletions
|
@ -105,6 +105,8 @@ describe("transforms", () => {
|
|||
["index.md", "index"],
|
||||
["test.mp4", "test.mp4"],
|
||||
["note with spaces.md", "note-with-spaces"],
|
||||
["test/special chars?.md", "test/special-chars-q"],
|
||||
["test/special chars #3.md", "test/special-chars-3"],
|
||||
],
|
||||
path.slugifyFilePath,
|
||||
path.isFilePath,
|
||||
|
|
|
@ -50,7 +50,9 @@ export function getFullSlug(window: Window): FullSlug {
|
|||
function sluggify(s: string): string {
|
||||
return s
|
||||
.split("/")
|
||||
.map((segment) => segment.replace(/\s/g, "-").replace(/%/g, "-percent").replace(/\?/g, "-q")) // slugify all segments
|
||||
.map((segment) =>
|
||||
segment.replace(/\s/g, "-").replace(/%/g, "-percent").replace(/\?/g, "-q").replace(/#/g, ""),
|
||||
) // slugify all segments
|
||||
.join("/") // always use / as sep
|
||||
.replace(/\/$/, "")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue