File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ const Markdoc = require('@markdoc/markdoc');
4
4
5
5
const DEFAULT_SCHEMA_PATH = './markdoc' ;
6
6
7
+ function normalize ( s ) {
8
+ return s . replace ( / \\ / g, '\\\\' ) ;
9
+ }
10
+
7
11
async function gatherPartials ( ast , schemaDir ) {
8
12
let partials = { } ;
9
13
@@ -128,7 +132,7 @@ async function load(source) {
128
132
async function readDir ( variable ) {
129
133
try {
130
134
const module = await resolve ( schemaDir , variable ) ;
131
- return `import * as ${ variable } from '${ module } '` ;
135
+ return `import * as ${ variable } from '${ normalize ( module ) } '` ;
132
136
} catch ( error ) {
133
137
return `const ${ variable } = {};` ;
134
138
}
@@ -162,7 +166,7 @@ import yaml from 'js-yaml';
162
166
// renderers is imported separately so Markdoc isn't sent to the client
163
167
import Markdoc, {renderers} from '@markdoc/markdoc'
164
168
165
- import {getSchema} from '${ await resolve ( __dirname , './runtime' ) } ';
169
+ import {getSchema} from '${ normalize ( await resolve ( __dirname , './runtime' ) ) } ';
166
170
/**
167
171
* Schema is imported like this so end-user's code is compiled using build-in babel/webpack configs.
168
172
* This enables typescript/ESnext support
You can’t perform that action at this time.
0 commit comments