Closed magick93 closed 3 years ago
Hi! Nope, that's it. marked
(and thus svelte-markdown
) just put that in a <pre><code>
block. <pre>
should keep the formatting just as-is unless your CSS is somehow messing with that.
Ok.
This is what is being rendered: - while the <pre>
and <code>
tags are there, notice the 3 ticks at the beginning and ending are preserved. Whereas in Github the <pre>
and <code>
replace the ticks.
<pre class=""><code>```
const getAdapters = (adapt) => {
// eslint-disable-next-line no-console
console.log(`adapter is ${adapt}`);
switch (adapt) {
case 'node':
return nodeAdapter;
case 'static':
return staticAdapter;
case 'netlify':
return netlifyAdapter;
case 'vercel':
return vercelAdapter;
default:
return nodeAdapter;
}
};
```</code></pre>
~Do you have an example of how you're rendering it? Depending on how you're obtaining the code, you might need to escape the back-ticks.~ Nevermind. I managed to reproduce this. Let me check why this is happening!
Fixed in 0.1.12, feel free to close this if it's working for you as well
I'm closing this since there was no further follow ups. If this still does not work for you somehow, feel free to reopen it.
Is there anything additional I need to do to get code formating to work?
The markdown I'm using is (the \ only to the below so the code can be rendered in GH):
When rendered, the output is exactly as the input.
Thanks