@@ -73,7 +73,7 @@ export default function prepPage(meta, options, isDev) {
73
73
const nestedPath = / ( [ ^ _ ] [ a - z A - z ] * ?) \/ [ ^ a - z _ ] * /
74
74
const matchedPath = options . page . match ( nestedPath )
75
75
if ( matchedPath && matchedPath [ 1 ] !== 'index' ) {
76
- cached . path = join ( matchedPath [ 1 ] , permalink )
76
+ cached . path = matchedPath [ 1 ] + permalink
77
77
} else {
78
78
cached . path = permalink
79
79
}
@@ -89,10 +89,8 @@ export default function prepPage(meta, options, isDev) {
89
89
const { year, month, day } = splitDate ( date )
90
90
const params = { section, slug, date, year, month, day }
91
91
const toPermalink = permalinkCompiler ( options . permalink )
92
- cached . permalink = join (
93
- '/' ,
94
- toPermalink ( params , { pretty : true } ) . replace ( / % 2 F / gi, '/' )
95
- ) // make url encoded slash pretty
92
+ cached . permalink =
93
+ '/' + toPermalink ( params , { pretty : true } ) . replace ( / % 2 F / gi, '/' ) // make url encoded slash pretty
96
94
}
97
95
return cached . permalink
98
96
} ,
@@ -114,7 +112,7 @@ export default function prepPage(meta, options, isDev) {
114
112
115
113
let result
116
114
const anchors = [ ]
117
- while ( ( result = anchorsExp . exec ( _rawData ) ) ) {
115
+ while ( ( result = anchorsExp . exec ( _rawData . body ) ) ) {
118
116
// eslint-disable-next-line no-unused-vars
119
117
const [ match , codeSnippet , otherHeading , headingText ] = result
120
118
if ( ! ( codeSnippet || otherHeading ) && headingText ) {
@@ -141,7 +139,8 @@ export default function prepPage(meta, options, isDev) {
141
139
const { parsers } = options
142
140
const { dirName, section, fileName } = meta
143
141
if ( fileName . search ( / \. c o m p \. m d $ / ) > - 1 ) {
144
- const relativePath = '.' + join ( dirName , section , fileName )
142
+ const relativePath =
143
+ '.' + join ( dirName , section , fileName ) . replace ( / \\ / , '/' ) // normalize windows path
145
144
cached . body = {
146
145
relativePath // component body compiled by loader and imported separately
147
146
}
0 commit comments