@@ -52,13 +52,13 @@ async function load(source) {
52
52
dir, // Root directory from Next.js (contains next.config.js)
53
53
mode = 'static' ,
54
54
schemaPath = DEFAULT_SCHEMA_PATH ,
55
- tokenizerOptions : { slots = false , ...tokenizerOptions } = {
55
+ options : { slots = false , ...options } = {
56
56
allowComments : true ,
57
57
} ,
58
58
appDir = false ,
59
59
} = this . getOptions ( ) || { } ;
60
60
61
- const tokenizer = new Markdoc . Tokenizer ( tokenizerOptions ) ;
61
+ const tokenizer = new Markdoc . Tokenizer ( options ) ;
62
62
63
63
const schemaDir = path . resolve ( dir , schemaPath || DEFAULT_SCHEMA_PATH ) ;
64
64
const tokens = tokenizer . tokenize ( source ) ;
@@ -134,7 +134,7 @@ import {getSchema, defaultObject} from '${normalize(
134
134
${ schemaCode }
135
135
136
136
const tokenizer = new Markdoc.Tokenizer(${
137
- tokenizerOptions ? JSON . stringify ( tokenizerOptions ) : ''
137
+ options ? JSON . stringify ( options ) : ''
138
138
} );
139
139
140
140
/**
@@ -195,13 +195,17 @@ async function getMarkdocData(context = {}) {
195
195
);
196
196
}
197
197
198
- ${ appDir ? '' : `export async function ${ dataFetchingFunction } (context) {
198
+ ${
199
+ appDir
200
+ ? ''
201
+ : `export async function ${ dataFetchingFunction } (context) {
199
202
return {
200
203
props: {
201
204
markdoc: await getMarkdocData(context),
202
205
},
203
206
};
204
- }` }
207
+ }`
208
+ }
205
209
206
210
export default${ appDir ? ' async' : '' } function MarkdocComponent(props) {
207
211
const markdoc = ${ appDir ? 'await getMarkdocData()' : 'props.markdoc' } ;
0 commit comments