@@ -3166,7 +3166,6 @@ it.each(["ul", "ol", "blockquote", "pre"])(
31663166) ;
31673167
31683168it . each ( [
3169- [ "first\nsecond" , '<a href="https://example.com">first<br>second</a>' ] ,
31703169 [
31713170 "Ship 🚀 guide" ,
31723171 'Ship <img data-stringify-type="emoji" alt="🚀"> <a href="https://example.com">guide</a>' ,
@@ -3212,3 +3211,27 @@ it.each([
32123211 href ,
32133212 ] ) ;
32143213} ) ;
3214+
3215+ it . each ( [
3216+ [
3217+ "Title\nDescription" ,
3218+ "\n <div>Title</div>\n\n <div>Description</div>\n" ,
3219+ "Title Description" ,
3220+ ] ,
3221+ [ "safe\n\n# SECRET" , "safe\n\n# SECRET" , "safe # SECRET" ] ,
3222+ [ "first\nsecond" , "first<br>second" , "first second" ] ,
3223+ [ "first\nsecond" , "<div>first</div><div>second</div>" , "first second" ] ,
3224+ ] ) (
3225+ "normalizes external link labels into one Markdown paragraph: %s" ,
3226+ ( plain , inner , label ) => {
3227+ for ( const text of [ plain , "" ] ) {
3228+ const h = mount ( ) ;
3229+ paste ( h . input , text , `<a href="https://example.com/">${ inner } </a>` ) ;
3230+ expect ( h . markdown ( ) . trim ( ) ) . toBe ( `[${ label } ](https://example.com/)` ) ;
3231+ expect ( scanMarkdown ( h . markdown ( ) ) . links . map ( ( link ) => link . url ) ) . toEqual ( [
3232+ "https://example.com/" ,
3233+ ] ) ;
3234+ expect ( h . input ) . toHaveTextContent ( label ) ;
3235+ }
3236+ } ,
3237+ ) ;
0 commit comments