From 159866f0321aac0e7ebf5635de5528b3a0b32ce2 Mon Sep 17 00:00:00 2001 From: mAAdhaTTah Date: Tue, 21 Nov 2017 16:40:35 -0500 Subject: [PATCH] Test case showing `code` element is blocks & spans --- src/__snapshots__/index.test.js.snap | 8 ++++++++ src/index.test.js | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/__snapshots__/index.test.js.snap b/src/__snapshots__/index.test.js.snap index a46d0a0..c951318 100644 --- a/src/__snapshots__/index.test.js.snap +++ b/src/__snapshots__/index.test.js.snap @@ -29,6 +29,14 @@ exports[`should allow overriding code element with components version 1`] = ` `; +exports[`should allow overriding codeblock element with components version 1`] = ` +
+
+ code +
+
+`; + exports[`should be able to combine in compilation 1`] = `

{ expect(tree).toMatchSnapshot(); }); +it('should allow overriding codeblock element with components version', () => { + const compile = marksyComponents({ + createElement, + elements: { + code() { + return
code
+ } + } + }); + const compiled = compile('```js\nconst foo = "bar"\n```'); + + const tree = renderer.create( + {compiled.tree} + ).toJSON(); + + expect(tree).toMatchSnapshot(); +}); + it('should highlight code with highlight.js', () => { const compile = marksy({ createElement,