게시물 HTML iframe 블록 추가
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script setup>
|
||||
import { parseIframeEmbedMarkup } from '../../lib/markdown-iframe-embed.js'
|
||||
|
||||
const props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
@@ -98,6 +100,7 @@ const youtubeId = computed(() => getYouTubeId(props.url))
|
||||
const youtubeEmbedUrl = computed(() => youtubeId.value ? `https://www.youtube.com/embed/${youtubeId.value}` : '')
|
||||
const tweetId = computed(() => getTweetId(props.url))
|
||||
const mastodonEmbedUrl = computed(() => getMastodonEmbedUrl(props.url))
|
||||
const customIframe = computed(() => parseIframeEmbedMarkup(props.url))
|
||||
const mastodonIframeRef = ref(null)
|
||||
const mastodonEmbedHeight = ref(640)
|
||||
const mastodonEmbedId = ref(0)
|
||||
@@ -230,6 +233,18 @@ watch(mastodonEmbedUrl, () => {
|
||||
scrolling="no"
|
||||
@load="requestMastodonEmbedHeight"
|
||||
/>
|
||||
<iframe
|
||||
v-else-if="customIframe"
|
||||
class="prose-embed__custom block w-full border-0"
|
||||
:src="customIframe.src"
|
||||
:title="customIframe.title"
|
||||
:allow="customIframe.allow"
|
||||
:height="customIframe.height || 480"
|
||||
:width="customIframe.width || undefined"
|
||||
:allowfullscreen="customIframe.allowFullscreen"
|
||||
loading="lazy"
|
||||
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-presentation"
|
||||
/>
|
||||
<a
|
||||
v-else-if="safeExternalUrl"
|
||||
class="prose-embed__link block p-5 text-sm font-semibold text-[var(--site-text)] hover:opacity-70"
|
||||
|
||||
Reference in New Issue
Block a user