Skip to content

Commit

Permalink
fix: code block formatting in one line
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
  • Loading branch information
aonnikov committed Oct 10, 2024
1 parent e2d1b54 commit fa4c409
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/presentation/src/components/markup/CodeBlockNode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
export let node: MarkupNode
export let preview = false
const is = diffview.component.Highlight
$: language = node.attrs?.language
$: content = node.content ?? []
$: value = content.map((node) => node.text).join('/n')
$: margin = preview ? '0' : null
$: props = { value, language }
</script>

{#if node}
<pre class="proseCodeBlock" style:margin={preview ? '0' : null}>
<code>
<Component is={diffview.component.Highlight} props={{ value, language }} />
</code>
</pre>
<pre class="proseCodeBlock" style:margin><code><Component {is} {props} /></code></pre>
{/if}

0 comments on commit fa4c409

Please sign in to comment.