summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/test/entities.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2022-07-26 17:31:57 -0400
committerGravatar GitHub <noreply@github.com> 2022-07-26 17:31:57 -0400
commitda5e6ca128985a26842f630c45fcc989ba3ecf3a (patch)
tree7576785c8d167b3bb25687a02623b864f3475218 /packages/markdown/remark/test/entities.test.js
parentc57242d5340fbf4bc9b0bfefc49fdbe2a79e82a5 (diff)
downloadastro-da5e6ca128985a26842f630c45fcc989ba3ecf3a.tar.gz
astro-da5e6ca128985a26842f630c45fcc989ba3ecf3a.tar.zst
astro-da5e6ca128985a26842f630c45fcc989ba3ecf3a.zip
Add tests for markdown content escaping (#4058)
Diffstat (limited to 'packages/markdown/remark/test/entities.test.js')
-rw-r--r--packages/markdown/remark/test/entities.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/markdown/remark/test/entities.test.js b/packages/markdown/remark/test/entities.test.js
new file mode 100644
index 000000000..a6b5918a5
--- /dev/null
+++ b/packages/markdown/remark/test/entities.test.js
@@ -0,0 +1,12 @@
+import { renderMarkdown } from '../dist/index.js';
+import { expect } from 'chai';
+
+describe('entities', () => {
+ const renderAstroMd = (text) => renderMarkdown(text, { isAstroFlavoredMd: false });
+
+ it('should not unescape entities', async () => {
+ const { code } = await renderAstroMd(`&lt;i&gt;This should NOT be italic&lt;/i&gt;`);
+
+ expect(code).to.equal(`<p>&#x3C;i>This should NOT be italic&#x3C;/i></p>`);
+ });
+});