File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ const Link = TipTapLink.extend({
3838 href : {
3939 default : null ,
4040 } ,
41+ title : {
42+ default : null ,
43+ } ,
4144 }
4245 } ,
4346
@@ -48,14 +51,14 @@ const Link = TipTapLink.extend({
4851 tag : 'a[href]' ,
4952 getAttrs : dom => ( {
5053 href : parseHref ( dom ) ,
54+ title : dom . getAttribute ( 'title' ) ,
5155 } ) ,
5256 } ,
5357 ] ,
5458
5559 renderHTML : ( { mark, HTMLAttributes } ) => [ 'a' , {
5660 ...mark . attrs ,
5761 href : domHref ( mark ) ,
58- title : mark . attrs . href ,
5962 rel : 'noopener noreferrer nofollow' ,
6063 } , 0 ] ,
6164
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ describe('Markdown though editor', () => {
8383 } )
8484 test ( 'links' , ( ) => {
8585 expect ( markdownThroughEditor ( '[test](foo)' ) ) . toBe ( '[test](foo)' )
86+ expect ( markdownThroughEditor ( '[test](foo "bar")' ) ) . toBe ( '[test](foo "bar")' )
8687 } )
8788 test ( 'images' , ( ) => {
8889 expect ( markdownThroughEditor ( '' ) ) . toBe ( '' )
You can’t perform that action at this time.
0 commit comments