entities.test.js 554 B

123456789101112131415161718
  1. import assert from 'node:assert/strict';
  2. import { describe, it, before } from 'node:test';
  3. import { createMarkdownProcessor } from '../dist/index.js';
  4. describe('entities', async () => {
  5. let processor;
  6. before(async () => {
  7. processor = await createMarkdownProcessor();
  8. });
  9. it('should not unescape entities in regular Markdown', async () => {
  10. const markdown = `<i>This should NOT be italic</i>`;
  11. const { code } = await processor.render(markdown);
  12. assert.equal(code, `<p>&#x3C;i>This should NOT be italic&#x3C;/i></p>`);
  13. });
  14. });