Skip to content

remark-obsidian plugin doesn't work #544

Answered by iicdii
iicdii asked this question in Q&A
Discussion options

You must be logged in to vote

Self Answer

Adding rehype-raw solved the issue.

rspress.config.ts

import path from 'path';
import { defineConfig } from 'rspress/config';
import remarkObsidian from 'remark-obsidian';
import rehypeRaw from 'rehype-raw';

const mdxNodeTypes = /** @type {const} */ [
  "mdxFlowExpression",
  "mdxJsxFlowElement",
  "mdxJsxTextElement",
  "mdxTextExpression",
  "mdxjsEsm",
];

export default defineConfig({
  markdown: {
    mdxRs: false,
    remarkPlugins: [remarkObsidian],
    rehypePlugins: [[rehypeRaw, { passThrough: mdxNodeTypes }]],
  },
  // ...
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sanyuan0704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant