summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/test/expressions.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/test/expressions.test.js')
-rw-r--r--packages/markdown/remark/test/expressions.test.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/markdown/remark/test/expressions.test.js b/packages/markdown/remark/test/expressions.test.js
index 2963ff7f1..12ddc1f48 100644
--- a/packages/markdown/remark/test/expressions.test.js
+++ b/packages/markdown/remark/test/expressions.test.js
@@ -79,4 +79,24 @@ describe('expressions', () => {
chai.expect(code).to.equal(`{frontmatter.list.map(item => <p id={item}>{item}</p>)}`);
});
+
+ it('should unwrap HTML comments in inline code blocks', async () => {
+ const { code } = await renderMarkdown(
+ `\`{/*<!-- HTML comment -->*/}\``
+ );
+
+ chai.expect(code).to.equal('<p><code is:raw>&lt;!-- HTML comment --&gt;</code></p>');
+ });
+
+ it('should unwrap HTML comments in code fences', async () => {
+ const { code } = await renderMarkdown(
+ `
+ \`\`\`
+ <!-- HTML comment -->
+ \`\`\`
+ `
+ );
+
+ chai.expect(code).to.match(/(?<!{\/\*)&lt;!-- HTML comment --&gt;(?!\*\/})/);
+ });
});