diff options
-rw-r--r-- | packages/markdown/remark/src/rehype-escape.ts | 2 | ||||
-rw-r--r-- | packages/markdown/remark/test/entities.test.js | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/packages/markdown/remark/src/rehype-escape.ts b/packages/markdown/remark/src/rehype-escape.ts index b0a4cb923..a4cc32cf7 100644 --- a/packages/markdown/remark/src/rehype-escape.ts +++ b/packages/markdown/remark/src/rehype-escape.ts @@ -1,4 +1,4 @@ -import { visit, SKIP } from 'unist-util-visit'; +import { SKIP, visit } from 'unist-util-visit'; export function escapeEntities(value: string): string { return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); diff --git a/packages/markdown/remark/test/entities.test.js b/packages/markdown/remark/test/entities.test.js index dff844329..b7d551d72 100644 --- a/packages/markdown/remark/test/entities.test.js +++ b/packages/markdown/remark/test/entities.test.js @@ -11,13 +11,10 @@ describe('entities', () => { }); it('should not escape entities in code blocks twice in Astro-flavored markdown', async () => { - const { code } = await renderMarkdown( - `\`\`\`astro\n<h1>{x && x.name || ''}!</h1>\n\`\`\``, - { - isAstroFlavoredMd: true, - syntaxHighlight: false, - } - ); + const { code } = await renderMarkdown(`\`\`\`astro\n<h1>{x && x.name || ''}!</h1>\n\`\`\``, { + isAstroFlavoredMd: true, + syntaxHighlight: false, + }); expect(code).to.equal( `<pre is:raw><code class="language-astro"><h1>{x && x.name || ''}!</h1>\n</code></pre>` |