mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
26 lines
809 B
JavaScript
26 lines
809 B
JavaScript
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(`<p><i>This should NOT be italic</i></p>`);
|
|
});
|
|
|
|
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,
|
|
}
|
|
);
|
|
|
|
expect(code).to.equal(
|
|
`<pre is:raw><code class="language-astro"><h1>{x && x.name || ''}!</h1>\n</code></pre>`
|
|
);
|
|
});
|
|
});
|