@@ -152,7 +152,35 @@ test('markdownPlugins option', (t) => {
152152 undo ( )
153153} )
154154
155- test . only ( 'integration' , ( t ) => {
155+ test ( 'markdownPlugins option with options' , ( t ) => {
156+ const plugins = [ [ 1 , 'options' ] ]
157+ function MarkdownIt ( ) { }
158+ MarkdownIt . prototype . use = ( plugin , options ) => {
159+ t . truthy ( plugins [ 0 ] [ 0 ] === plugin )
160+ t . truthy ( plugins [ 0 ] [ 1 ] === options )
161+ }
162+ MarkdownIt . prototype . render = ( ) => { }
163+ MarkdownIt . prototype . renderInline = ( ) => { }
164+ const undo = standardRewired . __set__ ( 'MarkdownIt' , MarkdownIt )
165+ standardRewired ( { markdownPlugins : plugins } )
166+ undo ( )
167+ } )
168+
169+ test ( 'template option turns off evalCode' , ( t ) => {
170+ const out = standard ( { template : true } )
171+ const out2 = standard ( )
172+ t . is ( out . plugins [ 3 ] . name , '' )
173+ t . is ( out2 . plugins [ 3 ] . name , 'evalCodePlugin' )
174+
175+ const markup = fs . readFileSync ( path . join ( fixtures , 'index.sgr' ) , 'utf8' )
176+ return reshape ( out )
177+ . process ( markup )
178+ . then ( ( res ) => {
179+ t . is ( res . output ( ) . trim ( ) , '<p>__runtime.escape(“wow <strong>amazing</strong>”)</p>' )
180+ } )
181+ } )
182+
183+ test ( 'integration' , ( t ) => {
156184 const markup = fs . readFileSync ( path . join ( fixtures , 'index.sgr' ) , 'utf8' )
157185 return reshape ( standard ( ) )
158186 . process ( markup )
0 commit comments