@@ -98,8 +98,17 @@ async function _getDocs(
98
98
99
99
const boxes : string [ ] = [ ]
100
100
101
+ // Sanitize markdown
102
+ let content = compiled . content
103
+ // Remove <!-- --> comments from frontMatter
104
+ . replace ( FRONTMATTER_REGEX , '' )
105
+ // Remove extraneous comments from post
106
+ . replace ( COMMENT_REGEX , '' )
107
+ // Remove inline link syntax
108
+ . replace ( INLINE_LINK_REGEX , '$1' )
109
+
101
110
await compileMDX ( {
102
- source : compiled . content ,
111
+ source : content ,
103
112
options : {
104
113
mdxOptions : {
105
114
rehypePlugins : [
@@ -116,7 +125,8 @@ async function _getDocs(
116
125
boxes,
117
126
//
118
127
file,
119
- compiled,
128
+ content,
129
+ frontmatter,
120
130
}
121
131
} ) ,
122
132
)
@@ -135,7 +145,8 @@ async function _getDocs(
135
145
boxes,
136
146
// Passed from the 1st pass
137
147
file,
138
- compiled,
148
+ content,
149
+ frontmatter,
139
150
} ) => {
140
151
const relFilePath = file . substring ( root . length ) // "/getting-started/tutorials/store.mdx"
141
152
@@ -159,8 +170,6 @@ async function _getDocs(
159
170
// frontmatter
160
171
//
161
172
162
- const frontmatter = compiled . data
163
-
164
173
const description : string = frontmatter . description ?? ''
165
174
166
175
const sourcecode : string = frontmatter . sourcecode ?? ''
@@ -191,15 +200,6 @@ async function _getDocs(
191
200
// } as Doc
192
201
// }
193
202
194
- // Sanitize markdown
195
- let content = compiled . content
196
- // Remove <!-- --> comments from frontMatter
197
- . replace ( FRONTMATTER_REGEX , '' )
198
- // Remove extraneous comments from post
199
- . replace ( COMMENT_REGEX , '' )
200
- // Remove inline link syntax
201
- . replace ( INLINE_LINK_REGEX , '$1' )
202
-
203
203
//
204
204
// inline images
205
205
//
0 commit comments