2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2019-04-29 02:11:57 +02:00
|
|
|
<template>
|
2023-05-27 04:35:26 +02:00
|
|
|
<div class="_gaps">
|
2023-11-04 10:27:22 +01:00
|
|
|
<Mfm :text="block.text" :isNote="false"/>
|
2023-05-27 04:35:26 +02:00
|
|
|
<MkUrlPreview v-for="url in urls" :key="url" :url="url"/>
|
2019-04-29 02:11:57 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-14 03:50:21 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { defineAsyncComponent } from 'vue';
|
2022-12-27 10:29:39 +01:00
|
|
|
import * as mfm from 'mfm-js';
|
2023-05-14 03:50:21 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { TextBlock } from './block.type';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
|
|
|
import { $i } from '@/account.js';
|
2019-04-29 02:11:57 +02:00
|
|
|
|
2023-05-14 03:50:21 +02:00
|
|
|
const MkUrlPreview = defineAsyncComponent(() => import('@/components/MkUrlPreview.vue'));
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
block: TextBlock,
|
|
|
|
page: Misskey.entities.Page,
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const urls = props.block.text ? extractUrlFromMfm(mfm.parse(props.block.text)) : [];
|
2019-04-29 02:11:57 +02:00
|
|
|
</script>
|