You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to show some of my source files within my MDSvex/Sveltekit based blog,
and I can easily import the source file as text using Vite's raw syntax for that and
present the source code to the user inside a <pre></pre> Tag.
Now I would like to have code highlighting with Prism from MDSvex, but this ist not possible,
due to MDS vex preprocessing is done before Svelte compile, right?
So, what is the preferred way to apply Code Highlighting then? Do I have to duplicate code for Highlighting and create a Svelte component for that like this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to show some of my source files within my MDSvex/Sveltekit based blog,
and I can easily import the source file as text using Vite's raw syntax for that and
present the source code to the user inside a
<pre></pre>
Tag.Now I would like to have code highlighting with Prism from MDSvex, but this ist not possible,
due to MDS vex preprocessing is done before Svelte compile, right?
So, what is the preferred way to apply Code Highlighting then? Do I have to duplicate code for Highlighting and create a Svelte component for that like this?
Is there a CodeHighlight component already available?
Or is there another approach where I can influence the order of interpretation somehow?
Beta Was this translation helpful? Give feedback.
All reactions