Fix code blocks

This commit is contained in:
Jon Staab
2024-11-19 08:37:09 -08:00
parent ed738f64c8
commit 6ff798f4e8
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -96,7 +96,9 @@
{:else if isTopic(parsed)}
<ContentTopic value={parsed.value} />
{:else if isCode(parsed)}
<ContentCode value={parsed.value} isBlock={isStartAndEnd(i)} />
<ContentCode
value={parsed.value}
isBlock={isStartAndEnd(i) || parsed.value.includes("\n")} />
{:else if isCashu(parsed) || isInvoice(parsed)}
<ContentToken value={parsed.value} />
{:else if isLink(parsed)}
+4 -2
View File
@@ -3,6 +3,8 @@
export let isBlock
</script>
<code class="link-content w-full" class:block={isBlock}>
{value}
<code
class="w-full overflow-auto whitespace-pre rounded bg-neutral p-2 text-neutral-content"
class:block={isBlock}>
{value.trim()}
</code>