fix: improve app markdown rendering

This commit is contained in:
Ruben Fiszel
2025-02-24 19:33:14 +01:00
parent a6763e53f0
commit d836bb6f5c
@@ -73,7 +73,7 @@
'h-full w-full overflow-y-auto prose max-w-full',
resolvedConfig?.size ? proseMapping[resolvedConfig.size] : '',
css?.container?.class,
' dark:prose-invert',
'dark:prose-invert',
'wm-markdown'
)}
style={css?.container?.style}
@@ -86,14 +86,42 @@
{id}
bind:initializing
bind:result
>
{#if result}
{#key result}
<Markdown md={result} plugins={[gfmPlugin()]} />
{/key}
{/if}
>{#if result}{#key result}<Markdown md={result} plugins={[gfmPlugin()]} />{/key}{/if}
</RunnableWrapper>
</div>
{:else}
<RunnableWrapper {outputs} render={false} autoRefresh {componentInput} {id} />
{/if}
<style global>
.wm-markdown p:first-child {
margin-top: 0;
}
.wm-markdown p:last-child {
margin-bottom: 0;
}
.wm-markdown h1:first-child {
margin-top: 0;
}
.wm-markdown h1:last-child {
margin-bottom: 0;
}
.wm-markdown h2:first-child {
margin-top: 0;
}
.wm-markdown h2:last-child {
margin-bottom: 0;
}
.wm-markdown h3:first-child {
margin-top: 0;
}
.wm-markdown h3:last-child {
margin-bottom: 0;
}
.wm-markdown h4:first-child {
margin-top: 0;
}
.wm-markdown h4:last-child {
margin-bottom: 0;
}
</style>