summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/global/MkMfm.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-04 16:41:08 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2024-10-04 16:41:08 +0900
commitea2675eaabe891e55702e0abd955650744feade5 (patch)
treea4da59793782ab43496e61d7ad3f455a88133e7a /packages/frontend/src/components/global/MkMfm.ts
parentBump version to 2024.10.0-beta.3 (diff)
downloadmisskey-ea2675eaabe891e55702e0abd955650744feade5.tar.gz
misskey-ea2675eaabe891e55702e0abd955650744feade5.tar.bz2
misskey-ea2675eaabe891e55702e0abd955650744feade5.zip
fix(frontend): リンク動作のオーバーライドが動作していないのを修正
Diffstat (limited to 'packages/frontend/src/components/global/MkMfm.ts')
-rw-r--r--packages/frontend/src/components/global/MkMfm.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/frontend/src/components/global/MkMfm.ts b/packages/frontend/src/components/global/MkMfm.ts
index d914492231..1beb8874e0 100644
--- a/packages/frontend/src/components/global/MkMfm.ts
+++ b/packages/frontend/src/components/global/MkMfm.ts
@@ -6,6 +6,7 @@
import { VNode, h, SetupContext, provide } from 'vue';
import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js';
+import { host } from '@@/js/config.js';
import MkUrl from '@/components/global/MkUrl.vue';
import MkTime from '@/components/global/MkTime.vue';
import MkLink from '@/components/MkLink.vue';
@@ -17,7 +18,6 @@ import MkCodeInline from '@/components/MkCodeInline.vue';
import MkGoogle from '@/components/MkGoogle.vue';
import MkSparkle from '@/components/MkSparkle.vue';
import MkA, { MkABehavior } from '@/components/global/MkA.vue';
-import { host } from '@@/js/config.js';
import { defaultStore } from '@/store.js';
function safeParseFloat(str: unknown): number | null {
@@ -57,7 +57,8 @@ type MfmEvents = {
// eslint-disable-next-line import/no-default-export
export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEvents>['emit'] }) {
- provide('linkNavigationBehavior', props.linkNavigationBehavior);
+ // こうしたいところだけど functional component 内では provide は使えない
+ //provide('linkNavigationBehavior', props.linkNavigationBehavior);
const isNote = props.isNote ?? true;
const shouldNyaize = props.nyaize ? props.nyaize === 'respect' ? props.author?.isCat : false : false;
@@ -350,6 +351,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(),
url: token.props.url,
rel: 'nofollow noopener',
+ navigationBehavior: props.linkNavigationBehavior,
})];
}
@@ -358,6 +360,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(),
url: token.props.url,
rel: 'nofollow noopener',
+ navigationBehavior: props.linkNavigationBehavior,
}, genEl(token.children, scale, true))];
}
@@ -366,6 +369,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,
+ navigationBehavior: props.linkNavigationBehavior,
})];
}
@@ -374,6 +378,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.linkNavigationBehavior,
}, `#${token.props.hashtag}`)];
}