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