File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ function slugify(heading: string): string {
1919}
2020
2121function slugFromPath ( linkPath : string ) : string {
22- return linkPath
23- . replace ( / R E A D M E \. m d $ / , '' )
24- . replace ( / \. m d $ / , '' )
25- . replace ( / \/ $ / , '' )
26- . split ( '/' )
27- . filter ( Boolean )
28- . pop ( ) ?? ''
22+ return (
23+ linkPath
24+ . replace ( / R E A D M E \. m d $ / , '' )
25+ . replace ( / \. m d $ / , '' )
26+ . replace ( / \/ $ / , '' )
27+ . split ( '/' )
28+ . filter ( Boolean )
29+ . pop ( ) ?? ''
30+ )
2931}
3032
3133interface PathMismatch {
@@ -115,9 +117,7 @@ for (const section of siteSections) {
115117
116118 const slug = slugFromPath ( linkPath )
117119 const parent =
118- parentStack . length > 0
119- ? parentStack [ parentStack . length - 1 ]
120- : undefined
120+ parentStack . length > 0 ? parentStack [ parentStack . length - 1 ] : undefined
121121
122122 if ( parent != null ) {
123123 // The parent's path determines the expected directory prefix.
You can’t perform that action at this time.
0 commit comments