pngwn / MDsveX

A markdown preprocessor for Svelte.

Home Page:https://mdsvex.pngwn.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rehype-code-titles & rehype-prism-plus not support

leokolt opened this issue · comments

Hi. I noticed that the plugins rehype-code-titles and rehype-prism-plus do not work. Below is the code of how I added the configuration. rehype-code-titles should add the name of the code block via this syntax ```ts:src/pages/index.js but instead, he just writes in the code that this is such a language ts:src/pages/index.js. rehype-prism-plus adds the ability to use line numbering and highlight multiple lines indicating the added or deleted code.


//svelte.config.ts
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';

import { mdsvex } from 'mdsvex'

import rehypePrism from 'rehype-prism-plus'
import rehypeCodeTitles from 'rehype-code-titles'
import rehypeSlug from 'rehype-slug'

/** @type {import('mdsvex').MdsvexOptions} */
const mdsvexOptions = {
	extensions: ['.md'],
    rehypePlugins: [
        rehypeCodeTitles,
        rehypePrism,
        rehypeSlug
      ]
}


/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://kit.svelte.dev/docs/integrations#preprocessors
	// for more information about preprocessors
	extensions: ['.svelte', '.md'],
	preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],

	kit: {
		// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
		// If your environment is not supported or you settled on a specific environment, switch out the adapter.
		// See https://kit.svelte.dev/docs/adapters for more information about adapters.
		adapter: adapter()
	}
};

export default config;


silence

Same issue here

I think I know the problem