open links in abuse comment in new window (#13381)
* feat: changing MkA behavior from MkMFM
* chore: open links in abuse comment in new window
* docs(changelog): 通報のコメント内のリンクをクリックした際、ウィンドウで開くように
* chore: use inject instead of prop drilling
* Revert "chore: use inject instead of prop drilling"
This reverts commit b4dd14eacf
.
This commit is contained in:
@@ -16,7 +16,7 @@ import MkCode from '@/components/MkCode.vue';
|
||||
import MkCodeInline from '@/components/MkCodeInline.vue';
|
||||
import MkGoogle from '@/components/MkGoogle.vue';
|
||||
import MkSparkle from '@/components/MkSparkle.vue';
|
||||
import MkA from '@/components/global/MkA.vue';
|
||||
import MkA, {MkABehavior} from '@/components/global/MkA.vue';
|
||||
import { host } from '@/config.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { nyaize as doNyaize } from '@/scripts/nyaize.js';
|
||||
@@ -43,6 +43,7 @@ type MfmProps = {
|
||||
parsedNodes?: mfm.MfmNode[] | null;
|
||||
enableEmojiMenu?: boolean;
|
||||
enableEmojiMenuReaction?: boolean;
|
||||
linkBehavior?: MkABehavior;
|
||||
};
|
||||
|
||||
type MfmEvents = {
|
||||
@@ -342,6 +343,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
|
||||
key: Math.random(),
|
||||
url: token.props.url,
|
||||
rel: 'nofollow noopener',
|
||||
behavior: props.linkBehavior,
|
||||
})];
|
||||
}
|
||||
|
||||
@@ -350,6 +352,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
|
||||
key: Math.random(),
|
||||
url: token.props.url,
|
||||
rel: 'nofollow noopener',
|
||||
behavior: props.linkBehavior,
|
||||
}, genEl(token.children, scale, true))];
|
||||
}
|
||||
|
||||
@@ -358,6 +361,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
|
||||
key: Math.random(),
|
||||
host: (token.props.host == null && props.author && props.author.host != null ? props.author.host : token.props.host) ?? host,
|
||||
username: token.props.username,
|
||||
behavior: props.linkBehavior,
|
||||
})];
|
||||
}
|
||||
|
||||
@@ -366,6 +370,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
|
||||
key: Math.random(),
|
||||
to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`,
|
||||
style: 'color:var(--hashtag);',
|
||||
behavior: props.linkBehavior,
|
||||
}, `#${token.props.hashtag}`)];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user