File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ type AutoPreprocessOptions = {
47
47
pug ?: TransformerOptions < Options . Pug > ;
48
48
globalStyle ?: Options . GlobalStyle | boolean ;
49
49
replace ?: Options . Replace ;
50
+
50
51
// workaround while we don't have this
51
52
// https://github.com/microsoft/TypeScript/issues/17867
52
53
[ languageName : string ] :
@@ -212,7 +213,7 @@ export function autoPreprocess(
212
213
213
214
/** If no <template> was found, just return the original markup */
214
215
if ( ! templateMatch ) {
215
- return { code : content } ;
216
+ return markupTransformer ( { content , attributes : { } , filename } ) ;
216
217
}
217
218
218
219
const [ fullMatch , attributesStr , templateCode ] = templateMatch ;
Original file line number Diff line number Diff line change @@ -186,4 +186,21 @@ describe('options', () => {
186
186
'<script lang="tomatoScript">tomato</script>' ,
187
187
) ;
188
188
} ) ;
189
+
190
+ it ( 'should be able to use default markup language with template tags' , async ( ) => {
191
+ const input = `potato` ;
192
+
193
+ const opts = autoPreprocess ( {
194
+ defaults : {
195
+ markup : 'potatoScript' ,
196
+ } ,
197
+ potatoScript ( { content } ) {
198
+ return { code : content . replace ( 'potato' , 'french-fries' ) } ;
199
+ } ,
200
+ } ) ;
201
+
202
+ const preprocessed = await preprocess ( input , opts ) ;
203
+
204
+ expect ( preprocessed . toString ( ) ) . toContain ( 'french-fries' ) ;
205
+ } ) ;
189
206
} ) ;
You can’t perform that action at this time.
0 commit comments