mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
062623438b
* chore: use biome to sort imports * do the sorting * Update package.json Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
33 lines
973 B
JavaScript
33 lines
973 B
JavaScript
import mdx from '@astrojs/mdx';
|
|
|
|
import * as assert from 'node:assert/strict';
|
|
import { before, describe, it } from 'node:test';
|
|
import { parseHTML } from 'linkedom';
|
|
import { loadFixture } from '../../../astro/test/test-utils.js';
|
|
|
|
const FIXTURE_ROOT = new URL('./fixtures/mdx-escape/', import.meta.url);
|
|
|
|
describe('MDX frontmatter', () => {
|
|
let fixture;
|
|
before(async () => {
|
|
fixture = await loadFixture({
|
|
root: FIXTURE_ROOT,
|
|
integrations: [mdx()],
|
|
});
|
|
await fixture.build();
|
|
});
|
|
|
|
it('does not have unescaped HTML at top-level', async () => {
|
|
const html = await fixture.readFile('/index.html');
|
|
const { document } = parseHTML(html);
|
|
|
|
assert.equal(document.body.textContent.includes('<em'), false);
|
|
});
|
|
|
|
it('does not have unescaped HTML inside html tags', async () => {
|
|
const html = await fixture.readFile('/html-tag/index.html');
|
|
const { document } = parseHTML(html);
|
|
|
|
assert.equal(document.body.textContent.includes('<em'), false);
|
|
});
|
|
});
|