Fix ContentLinkInline

This commit is contained in:
Jon Staab
2026-01-12 10:12:47 -08:00
parent 9943728eab
commit fe30aa4af2
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -169,7 +169,7 @@
{#if isBlock(i)}
<ContentLinkBlock value={parsed.value} {event} />
{:else}
<ContentLinkInline value={parsed.value} />
<ContentLinkInline value={parsed.value} {event} />
{/if}
{:else if isProfile(parsed)}
<ContentMention value={parsed.value} {url} />
+4 -4
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import {call, displayUrl} from "@welshman/lib"
import {isRelayUrl} from "@welshman/util"
import {preventDefault} from "@lib/html"
import {preventDefault, stopPropagation} from "@lib/html"
import LinkRound from "@assets/icons/link-round.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
import Link from "@lib/components/Link.svelte"
@@ -10,7 +10,7 @@
import {PLATFORM_URL} from "@app/core/state"
import {makeSpacePath} from "@app/util/routes"
const {value} = $props()
const {value, event} = $props()
const url = value.url.toString()
const [href, external] = call(() => {
@@ -20,12 +20,12 @@
return [url, true]
})
const expand = () => pushModal(ContentLinkDetail, {url}, {fullscreen: true})
const expand = () => pushModal(ContentLinkDetail, {value, event}, {fullscreen: true})
</script>
{#if url.match(/\.(jpe?g|png|gif|webp)$/)}
<!-- Use a real link so people can copy the href -->
<a href={url} class="link-content whitespace-nowrap" onclick={preventDefault(expand)}>
<a href={url} class="link-content whitespace-nowrap" onclick={stopPropagation(preventDefault(expand))}>
<Icon icon={LinkRound} size={3} class="inline-block" />
{displayUrl(url)}
</a>
+1 -1
View File
@@ -116,7 +116,7 @@
{:else if isCashu(parsed) || isInvoice(parsed)}
<ContentToken value={parsed.value} />
{:else if isLink(parsed)}
<ContentLinkInline value={parsed.value} />
<ContentLinkInline value={parsed.value} {event} />
{:else if isProfile(parsed)}
<ContentMention value={parsed.value} {url} />
{:else if isQuote(parsed)}