markdoc icon indicating copy to clipboard operation
markdoc copied to clipboard

Code block followed by a string adds a <space> into the code block instead of outside

Open hgoona opened this issue 2 years ago • 2 comments

What happened?

I came across the below repl that sets up Markdoc for use with SvelteKit. It works fine but when i add a code block, followed by text, it adds an extra character into the code block, rather than outside, so the code block looks longer and joins the following words.

See below.

How can this be fixed?? Is it a bug?

To reproduce

Test in this repl where i found the code (not my repl):

Add this to the doc: \code` following word

`code` `

The result should look incorrect like this (but the last code line shows how I'd expect it to normally look: image

Version

0.3.1

Additional context

No response

hgoona avatar Aug 23 '23 22:08 hgoona

Hey @hgoona can you reproduce this in our Markdoc sandbox and share a link here? Thanks!

mfix-stripe avatar Aug 24 '23 16:08 mfix-stripe

Hey, just chiming in - this is a problem if you try to do a custom rendering using <svelte:self>, <svelte:element> and <svelte:component>. {@html Markdoc.renderers.html(node)} works though.

aretrosen avatar Jul 13 '24 12:07 aretrosen