fix: sluggify pound (closes #681)
| | |
| | | ["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, |
| | |
| | | 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(/\/$/, "") |
| | | } |