diff --git a/__tests__/compilers/html-block.test.ts b/__tests__/compilers/html-block.test.ts new file mode 100644 index 000000000..ecb830318 --- /dev/null +++ b/__tests__/compilers/html-block.test.ts @@ -0,0 +1,33 @@ +import { mdast, mdx } from '../../index'; + +describe('html-block compiler', () => { + it('compiles html blocks within containers', () => { + const markdown = ` +> 🚧 It compiles! +> +> {\` +> Hello, World! +> \`} +`; + + expect(mdx(mdast(markdown)).trim()).toBe(markdown.trim()); + }); + + it('compiles html blocks with indents', () => { + const markdown = ` +{\` + +const foo = () => { + const bar = { + baz: 'blammo' + } + + return bar +} + +\`} +`; + + expect(mdx(mdast(markdown)).trim()).toBe(markdown.trim()); + }); +});
+const foo = () => { + const bar = { + baz: 'blammo' + } + + return bar +} +