import { renderMarkdown } from '../dist/index.js'; import chai from 'chai'; describe('strictness in Astro-flavored markdown', () => { const renderAstroMd = (text, opts) => renderMarkdown(text, { isAstroFlavoredMd: true, ...opts }); it('should allow self-closing HTML tags (void elements)', async () => { const { code } = await renderAstroMd( `Use self-closing void elements
like wordbreak and images: `, {} ); chai .expect(code) .to.equal( `

Use self-closing void elements
like wordbreak and images: ` + `

` ); }); it('should allow attribute names starting with ":" after element names', async () => { const { code } = await renderAstroMd(`
Test
`, {}); chai.expect(code.trim()).to.equal(`
Test
`); }); it('should allow attribute names starting with ":" after local element names', async () => { const { code } = await renderAstroMd(`x`, {}); chai.expect(code.trim()).to.equal(`x`); }); it('should allow attribute names starting with ":" after attribute names', async () => { const { code } = await renderAstroMd(``, {}); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with ":" after local attribute names', async () => { const { code } = await renderAstroMd( ``, {} ); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with ":" after attribute values', async () => { const { code } = await renderAstroMd(``, {}); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after element names', async () => { const { code } = await renderAstroMd(``, {}); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after local element names', async () => { const { code } = await renderAstroMd( `Test`, {} ); chai.expect(code.trim()).to.equal(`Test`); }); it('should allow attribute names starting with "@" after attribute names', async () => { const { code } = await renderAstroMd( ``, {} ); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after local attribute names', async () => { const { code } = await renderAstroMd( ``, {} ); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names starting with "@" after attribute values', async () => { const { code } = await renderAstroMd( ``, {} ); chai.expect(code.trim()).to.equal(``); }); it('should allow attribute names containing dots', async () => { const { code } = await renderAstroMd(``, {}); chai.expect(code.trim()).to.equal(``); }); });