File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ export function createTransformerFactory(
129
129
catch ( error ) {
130
130
const result = onTwoslashError ( error , code , lang , this . options )
131
131
if ( typeof result === 'string' )
132
- return code
132
+ return result
133
133
}
134
134
}
135
135
} ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export function transformerTwoslash(options: VitePressPluginTwoslashOptions = {}
19
19
explicitTrigger = true ,
20
20
} = options
21
21
22
- const onError = ( error : any , code : string ) : void => {
22
+ const onError = ( error : any , code : string ) : string | void => {
23
23
const isCI = typeof process !== 'undefined' && process ?. env ?. CI
24
24
const isDev = typeof process !== 'undefined' && process ?. env ?. NODE_ENV === 'development'
25
25
const shouldThrow = ( options . throws || isCI || ! isDev ) && options . throws !== false
@@ -28,7 +28,7 @@ export function transformerTwoslash(options: VitePressPluginTwoslashOptions = {}
28
28
throw error
29
29
else
30
30
console . error ( error )
31
- removeTwoslashNotations ( code )
31
+ return removeTwoslashNotations ( code )
32
32
}
33
33
34
34
const twoslash = createTransformerFactory (
You can’t perform that action at this time.
0 commit comments