2019-04-29 09:11:57 +09:00
|
|
|
<template>
|
2023-05-27 11:35:26 +09:00
|
|
|
<div class="_gaps">
|
2023-05-17 11:42:50 +09:00
|
|
|
<Mfm :text="block.text" :isNote="false" :i="$i"/>
|
2023-05-27 11:35:26 +09:00
|
|
|
<MkUrlPreview v-for="url in urls" :key="url" :url="url"/>
|
2019-04-29 09:11:57 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-14 10:50:21 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { defineAsyncComponent } from 'vue';
|
2022-12-27 18:29:39 +09:00
|
|
|
import * as mfm from 'mfm-js';
|
2023-05-14 10:50:21 +09:00
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { TextBlock } from './block.type';
|
2021-11-12 02:02:25 +09:00
|
|
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
|
2023-04-01 13:52:07 +09:00
|
|
|
import { $i } from '@/account';
|
2019-04-29 09:11:57 +09:00
|
|
|
|
2023-05-14 10:50:21 +09: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 09:11:57 +09:00
|
|
|
</script>
|