File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -82,11 +82,11 @@ module.exports = class InlineLexer {
8282 }
8383
8484 src = src . substring ( cap [ 0 ] . length ) ;
85- out += this . options . sanitize
86- ? this . options . sanitizer
85+ out += this . renderer . html ( this . options . sanitize
86+ ? ( this . options . sanitizer
8787 ? this . options . sanitizer ( cap [ 0 ] )
88- : escape ( cap [ 0 ] )
89- : cap [ 0 ] ;
88+ : escape ( cap [ 0 ] ) )
89+ : cap [ 0 ] ) ;
9090 continue ;
9191 }
9292
Original file line number Diff line number Diff line change @@ -80,3 +80,14 @@ describe('changeDefaults', () => {
8080 expect ( require ( '../../src/defaults' ) . defaults . test ) . toBe ( true ) ;
8181 } ) ;
8282} ) ;
83+
84+ describe ( 'inlineLexer' , ( ) => {
85+ it ( 'should send html to renderer.html' , ( ) => {
86+ const renderer = new marked . Renderer ( ) ;
87+ spyOn ( renderer , 'html' ) . and . callThrough ( ) ;
88+ const md = 'HTML Image: <img alt="MY IMAGE" src="example.png" />' ;
89+ marked ( md , { renderer } ) ;
90+
91+ expect ( renderer . html ) . toHaveBeenCalledWith ( '<img alt="MY IMAGE" src="example.png" />' ) ;
92+ } ) ;
93+ } ) ;
You can’t perform that action at this time.
0 commit comments