3
3
* SPDX-License-Identifier: AGPL-3.0-only
4
4
*/
5
5
6
- import { VNode , h , SetupContext } from 'vue' ;
6
+ import { VNode , h , SetupContext , provide } from 'vue' ;
7
7
import * as mfm from 'mfm-js' ;
8
8
import * as Misskey from 'misskey-js' ;
9
9
import MkUrl from '@/components/global/MkUrl.vue' ;
@@ -43,7 +43,7 @@ type MfmProps = {
43
43
parsedNodes ?: mfm . MfmNode [ ] | null ;
44
44
enableEmojiMenu ?: boolean ;
45
45
enableEmojiMenuReaction ?: boolean ;
46
- linkBehavior ?: MkABehavior ;
46
+ linkNavigationBehavior ?: MkABehavior ;
47
47
} ;
48
48
49
49
type MfmEvents = {
@@ -52,6 +52,8 @@ type MfmEvents = {
52
52
53
53
// eslint-disable-next-line import/no-default-export
54
54
export default function ( props : MfmProps , { emit } : { emit : SetupContext < MfmEvents > [ 'emit' ] } ) {
55
+ provide ( 'linkNavigationBehavior' , props . linkNavigationBehavior ) ;
56
+
55
57
const isNote = props . isNote ?? true ;
56
58
const shouldNyaize = props . nyaize ? props . nyaize === 'respect' ? props . author ?. isCat : false : false ;
57
59
@@ -343,7 +345,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
343
345
key : Math . random ( ) ,
344
346
url : token . props . url ,
345
347
rel : 'nofollow noopener' ,
346
- behavior : props . linkBehavior ,
347
348
} ) ] ;
348
349
}
349
350
@@ -352,7 +353,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
352
353
key : Math . random ( ) ,
353
354
url : token . props . url ,
354
355
rel : 'nofollow noopener' ,
355
- behavior : props . linkBehavior ,
356
356
} , genEl ( token . children , scale , true ) ) ] ;
357
357
}
358
358
@@ -361,7 +361,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
361
361
key : Math . random ( ) ,
362
362
host : ( token . props . host == null && props . author && props . author . host != null ? props . author . host : token . props . host ) ?? host ,
363
363
username : token . props . username ,
364
- behavior : props . linkBehavior ,
365
364
} ) ] ;
366
365
}
367
366
@@ -370,7 +369,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
370
369
key : Math . random ( ) ,
371
370
to : isNote ? `/tags/${ encodeURIComponent ( token . props . hashtag ) } ` : `/user-tags/${ encodeURIComponent ( token . props . hashtag ) } ` ,
372
371
style : 'color:var(--hashtag);' ,
373
- behavior : props . linkBehavior ,
374
372
} , `#${ token . props . hashtag } ` ) ] ;
375
373
}
376
374
0 commit comments