fix(markdown): escape when mode == 'md' (#2971)
* Fix rehype escape * Changeset
This commit is contained in:
parent
75919537be
commit
ad3c391696
2 changed files with 8 additions and 6 deletions
5
.changeset/silent-cows-shave.md
Normal file
5
.changeset/silent-cows-shave.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/markdown-remark': patch
|
||||
---
|
||||
|
||||
Escape expressions when mode == 'md'
|
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue