File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 6
6
export let frontmatter = {}
7
7
8
8
let prev, next
9
- $: normalizedPath = normalizePath ($page .path )
9
+ $: markdownPath = normalizePath ($page .path ). replace ( / ^ \/ | \/ $ / g , " " )
10
10
$: {
11
11
let prevItem, currItem
12
12
for (const item of iterateMenuItem ($menuItems)) {
42
42
<div class =" footer-tools" >
43
43
<div class =" edit-link" >
44
44
<a
45
- href ="https://github.com/ota-meshi/eslint-plugin-svelte/edit/main/docs/ {normalizedPath .startsWith (
46
- ' /' ,
47
- )
48
- ? normalizedPath .slice (1 )
49
- : normalizedPath }.md"
45
+ href ="https://github.com/ota-meshi/eslint-plugin-svelte/edit/main/docs/ {markdownPath }.md"
50
46
target =" _blank"
51
47
rel =" noopener noreferrer" >Edit this page</a
52
48
>
Original file line number Diff line number Diff line change @@ -57,7 +57,11 @@ export function isActive(path, $page) {
57
57
}
58
58
59
59
export function normalizePath ( path ) {
60
- return path === "/" ? "/README" : path
60
+ let normalized = path === "/" ? "/README/" : path
61
+ if ( ! normalized . endsWith ( "/" ) ) {
62
+ normalized += "/"
63
+ }
64
+ return normalized
61
65
}
62
66
63
67
export const tocStore = writable ( [ ] )
You can’t perform that action at this time.
0 commit comments