Skip to content

Commit

Permalink
use a simpler and more correct fix for weird table layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliapixel committed Jun 27, 2024
1 parent 5dfd156 commit 4f1c2bb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/lib/AsyncMarkdownReq.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
return md;
}
const tableDiver: Partial<Renderer> = {
tablecell(content, _flags) {
return `<td><div class="flex flex-row gap-1.5">${content}</div></td>`;
// TailwindCSS makes img elements have display: block for *some* reason so
// this fixes it in this very specific instance ehehe
const imgFixer: Partial<Renderer> = {
image(href, title, text) {
return `<img src=${href} title=${title ?? text} alt=${text} style="display: inline-block;" />`;
}
};
marked.use({ renderer: tableDiver });
marked.use({ renderer: imgFixer });
</script>

<div>
{#await request(url)}
<!-- yea -->
{:then resp}
<div transition:slide={{ duration: 250 }}>
{@html marked.parse(resp)}
</div>
{/await}
</div>
{#await request(url)}
<!-- yea -->
{:then resp}
<div transition:slide={{ duration: 250 }}>
{@html marked.parse(resp)}
</div>
{/await}

0 comments on commit 4f1c2bb

Please sign in to comment.