2019-04-29 03:11:57 +03:00
|
|
|
<template>
|
2019-05-23 21:46:20 +03:00
|
|
|
<div class="mrdgzndn">
|
2023-05-14 04:50:21 +03:00
|
|
|
<Mfm :text="block.text" :is-note="false" :i="$i"/>
|
2021-11-19 12:36:12 +02:00
|
|
|
<MkUrlPreview v-for="url in urls" :key="url" :url="url" class="url"/>
|
2019-04-29 03:11:57 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-14 04:50:21 +03:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { defineAsyncComponent } from 'vue';
|
2022-12-27 11:29:39 +02:00
|
|
|
import * as mfm from 'mfm-js';
|
2023-05-14 04:50:21 +03:00
|
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
import { TextBlock } from './block.type';
|
2021-11-11 19:02:25 +02:00
|
|
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
|
2023-04-01 07:52:07 +03:00
|
|
|
import { $i } from '@/account';
|
2019-04-29 03:11:57 +03:00
|
|
|
|
2023-05-14 04:50:21 +03: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 03:11:57 +03:00
|
|
|
</script>
|
|
|
|
|
2022-12-27 11:29:39 +02:00
|
|
|
<style lang="scss" scoped>
|
2020-01-29 21:37:25 +02:00
|
|
|
.mrdgzndn {
|
|
|
|
&:not(:first-child) {
|
|
|
|
margin-top: 0.5em;
|
|
|
|
}
|
2019-05-23 21:46:20 +03:00
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
&:not(:last-child) {
|
|
|
|
margin-bottom: 0.5em;
|
|
|
|
}
|
2019-05-24 12:11:33 +03:00
|
|
|
|
2020-01-29 21:37:25 +02:00
|
|
|
> .url {
|
|
|
|
margin: 0.5em 0;
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 03:11:57 +03:00
|
|
|
</style>
|