@@ -112,17 +112,19 @@ describe("HTML in native Markdown", () => {
112112 } ) ;
113113
114114 it ( "keeps an anchor a link after a bang or with brackets in its text" , ( ) => {
115- for ( const markdown of [
116- "Done!<a href='https://example.com'>logs [1] ]</a>" ,
117- "<p>Done!<a href='https://example.com'>logs [1] ]</a></p>" ,
118- ] ) {
115+ for ( const [ markdown , text , label ] of [
116+ [ "Done!<a href='https://example.com'>logs [1] ]</a>" , "Done!" , "logs [1] ]" ] ,
117+ [ "<p>Done!<a href='https://example.com'>logs [1] ]</a></p>" , "Done!" , "logs [1] ]" ] ,
118+ [ "Done\\\\!<a href='https://example.com'>logs \\\\]</a>" , "Done\\!" , "logs \\]" ] ,
119+ [ "<p>Done\\\\!<a href='https://example.com'>logs \\\\]</a></p>" , "Done\\!" , "logs \\]" ] ,
120+ ] as const ) {
119121 const document = parseMarkdownDocument ( markdown ) ;
120122 const paragraph = document . children [ 0 ] ;
121123 expect ( paragraph ?. type ) . toBe ( "paragraph" ) ;
122124 if ( paragraph ?. type !== "paragraph" ) continue ;
123125 expect ( paragraph . children ) . toMatchObject ( [
124- { type : "text" , value : "Done!" } ,
125- { type : "link" , url : "https://example.com" , children : [ { value : "logs [1] ]" } ] } ,
126+ { type : "text" , value : text } ,
127+ { type : "link" , url : "https://example.com" , children : [ { value : label } ] } ,
126128 ] ) ;
127129 }
128130 const document = parseMarkdownDocument (
0 commit comments