Skip to content

Commit

Permalink
Fix rehype escape
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 committed Apr 2, 2022
1 parent a05177c commit d520b3d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/markdown/remark/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp

let parser = unified()
.use(markdown)
.use(isMDX ? [remarkJsx] : [])
.use(isMDX ? [remarkExpressions] : [])
.use(isMDX ? [remarkJsx, remarkExpressions] : [])
.use([remarkUnwrap]);

if (remarkPlugins.length === 0 && rehypePlugins.length === 0) {
Expand Down Expand Up @@ -91,10 +90,8 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp
});

parser
.use(isMDX ? [rehypeJsx] : [])
.use(isMDX ? [rehypeExpressions] : [])
.use(isMDX ? [] : [rehypeRaw])
.use(isMDX ? [rehypeEscape] : [])
.use(isMDX ? [rehypeJsx, rehypeExpressions] : [rehypeRaw])
.use(rehypeEscape)
.use(rehypeIslands);

let result: string;
Expand Down

0 comments on commit d520b3d

Please sign in to comment.