micromarkExtensions
not work?
#1414
Answered
by
ChristianMurphy
steve02081504
asked this question in
Q&A
-
I have an repo like this: import rehypeKatex from 'https://esm.run/rehype-katex'
import rehypeStringify from 'https://esm.run/rehype-stringify'
import remarkParse from 'https://esm.run/remark-parse'
import remarkRehype from 'https://esm.run/remark-rehype'
import remarkMath from 'https://esm.run/remark-math'
import { unified } from 'https://esm.run/unified'
import remarkGfm from 'https://esm.run/remark-gfm'
import remarkBreaks from 'https://esm.run/remark-breaks'
import rehypePrettyCode from 'https://esm.run/rehype-pretty-code'
import { transformerCopyButton } from 'https://esm.run/@rehype-pretty/transformers'
const convertor = unified()
.use(remarkParse)
.use(remarkBreaks)
.use(remarkMath)
.use(remarkRehype, {
allowDangerousHtml: true,
})
.use(remarkGfm, {
singleTilde: false,
})
.use(rehypePrettyCode, {
theme: {
dark: 'github-dark-dimmed',
light: 'github-light',
},
transformers: [
transformerCopyButton({
visibility: 'always',
feedbackDuration: 3_000,
}),
],
})
.use(rehypeKatex)
.use(rehypeStringify, {
allowDangerousCharacters: true,
allowDangerousHtml: true,
tightBreaks: true,
})
export async function renderMarkdown(markdown) {
const file = await convertor.process(markdown)
return String(file)
} and I wanna it leave the indented text as-is, so I tried this: //...
.use(remarkParse, {
micromarkExtensions: [{ disable: { null: ['codeIndented'] } }]
}) but it looks like not working |
Beta Was this translation helpful? Give feedback.
Answered by
ChristianMurphy
Feb 23, 2025
Replies: 1 comment 1 reply
-
Welcome @steve02081504! 👋 You want something like zestedesavoir/zmarkdown#416 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
steve02081504
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Welcome @steve02081504! 👋
Remark parser doesn't have a micromark extensions option https://github.com/remarkjs/remark/tree/main/packages/remark-parse#types
So passing one doesn't do anything.
You want something like zestedesavoir/zmarkdown#416 (comment)