rehype-default-code-lang
v1.0.0
Published
Add a default programming language to your code tags.
Readme
rehype-default-code-lang
Add a default programming language to your code tags.
[!TIP] This plugin is ideal for migrating to Shiki, as
@shikijs/rehypedoes not style code blocks without an explicit language. This plugin addresses that issue.
Features
- Automatically adds a default language class to
<code>tags that lack a language specification. - Facilitates the integration of syntax highlighting libraries like Shiki, especially when existing content lacks language annotations.
Installation
pnpm install rehype-default-code-langUsage
import { rehypeDefaultCodeLang } from 'rehype-default-code-lang'