feat: add rehype-prism-plus and docs
This commit is contained in:
@ -86,7 +86,7 @@ export async function getFileBySlug(type, slug) {
|
||||
options.rehypePlugins = [
|
||||
...(options.rehypePlugins ?? []),
|
||||
require('rehype-katex'),
|
||||
require('@mapbox/rehype-prism'),
|
||||
[require('rehype-prism-plus'), { ignoreMissing: true }],
|
||||
() => {
|
||||
return (tree) => {
|
||||
visit(tree, 'element', (node, index, parent) => {
|
||||
|
@ -4,8 +4,8 @@ module.exports = function (options) {
|
||||
return (tree) =>
|
||||
visit(tree, 'code', (node, index) => {
|
||||
const nodeLang = node.lang || ''
|
||||
let language = '',
|
||||
title = ''
|
||||
let language = ''
|
||||
let title = ''
|
||||
|
||||
if (nodeLang.includes(':')) {
|
||||
language = nodeLang.slice(0, nodeLang.search(':'))
|
||||
|
Reference in New Issue
Block a user