import { renderMarkdown } from '../dist/index.js'; import { expect } from 'chai'; describe('entities', () => { it('should not unescape entities in regular Markdown', async () => { const { code } = await renderMarkdown(`<i>This should NOT be italic</i>`, { isAstroFlavoredMd: false, }); expect(code).to.equal(`

<i>This should NOT be italic</i>

`); }); it('should not escape entities in code blocks twice in Astro-flavored markdown', async () => { const { code } = await renderMarkdown(`\`\`\`astro\n

{x && x.name || ''}!

\n\`\`\``, { isAstroFlavoredMd: true, syntaxHighlight: false, }); expect(code).to.equal( `
<h1>{x && x.name || ''}!</h1>\n
` ); }); });