Closed illright closed 4 years ago
Looks like I didn't update the docs. Highlight should be an object that accepts a highlighter
property:
// ...
import { mdsvex } from 'mdsvex';
function highlighter(code, _lang) {
console.log('called');
return `<pre>${code}</pre>`;
}
export default {
// ...
plugins: [
// ...
svelte({
extensions: ['.svelte', '.svx'],
preprocess: mdsvex({
highlight: { highlighter }
}),
}),
// ...
I'll update the documentation.
Can you give an example for the initial newline you mentioned?
The example for the issue would be the default configuration. Follow the same reproduction steps, but don't override the highlighter. Then the code from test.svx
will be rendered in a <pre>
element spanning two lines, the first line being just a linefeed and the second containing actual code
It looks like this:
```js console.log('hello there') console.log('general kenobi') ```
The default settings were used
https://svelte-materialify.netlify.app/components/buttons/ The SVX file
And the docs are still not updated
Fixed in #110.
Thanks @TheComputerM!
Steps to reproduce:
mdsvex
:yarn add -D mdsvex
rollup.config.js
:src/test.svx
) with the following content: