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)} {#if isBlock(i)}
<ContentLinkBlock value={parsed.value} {event} /> <ContentLinkBlock value={parsed.value} {event} />
{:else} {:else}
<ContentLinkInline value={parsed.value} /> <ContentLinkInline value={parsed.value} {event} />
{/if} {/if}
{:else if isProfile(parsed)} {:else if isProfile(parsed)}
<ContentMention value={parsed.value} {url} /> <ContentMention value={parsed.value} {url} />
+4 -4
View File
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import {call, displayUrl} from "@welshman/lib" import {call, displayUrl} from "@welshman/lib"
import {isRelayUrl} from "@welshman/util" 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 LinkRound from "@assets/icons/link-round.svg?dataurl"
import Icon from "@lib/components/Icon.svelte" import Icon from "@lib/components/Icon.svelte"
import Link from "@lib/components/Link.svelte" import Link from "@lib/components/Link.svelte"
@@ -10,7 +10,7 @@
import {PLATFORM_URL} from "@app/core/state" import {PLATFORM_URL} from "@app/core/state"
import {makeSpacePath} from "@app/util/routes" import {makeSpacePath} from "@app/util/routes"
const {value} = $props() const {value, event} = $props()
const url = value.url.toString() const url = value.url.toString()
const [href, external] = call(() => { const [href, external] = call(() => {
@@ -20,12 +20,12 @@
return [url, true] return [url, true]
}) })
const expand = () => pushModal(ContentLinkDetail, {url}, {fullscreen: true}) const expand = () => pushModal(ContentLinkDetail, {value, event}, {fullscreen: true})
</script> </script>
{#if url.match(/\.(jpe?g|png|gif|webp)$/)} {#if url.match(/\.(jpe?g|png|gif|webp)$/)}
<!-- Use a real link so people can copy the href --> <!-- 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" /> <Icon icon={LinkRound} size={3} class="inline-block" />
{displayUrl(url)} {displayUrl(url)}
</a> </a>
+1 -1
View File
@@ -116,7 +116,7 @@
{:else if isCashu(parsed) || isInvoice(parsed)} {:else if isCashu(parsed) || isInvoice(parsed)}
<ContentToken value={parsed.value} /> <ContentToken value={parsed.value} />
{:else if isLink(parsed)} {:else if isLink(parsed)}
<ContentLinkInline value={parsed.value} /> <ContentLinkInline value={parsed.value} {event} />
{:else if isProfile(parsed)} {:else if isProfile(parsed)}
<ContentMention value={parsed.value} {url} /> <ContentMention value={parsed.value} {url} />
{:else if isQuote(parsed)} {:else if isQuote(parsed)}