From b6f2b3f602bd25b94878f73b91e18f69e3d4b46f Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 5 May 2020 01:13:31 +0200 Subject: Add atx header inline test --- __tests__/index.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/__tests__/index.js b/__tests__/index.js index 6cfa471..cf61dfa 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -128,7 +128,7 @@ test('link', t => { t.deepEqual(parse(contents), parse('

This is a link :Test link

')); }); -test('atx header', t => { +test('header', t => { const imageMd = ` Title of the article ==================== @@ -139,6 +139,25 @@ Title of the article t.deepEqual(parse(contents), parse('

Title of the article

')); }); +test('atx header', t => { + const imageMd = ` +# Title of the article +{data-id="title"} + +`; + const {contents} = renderDefault(imageMd); + t.deepEqual(parse(contents), parse('

Title of the article

')); +}); + +test('atx header inline', t => { + const imageMd = ` +# Title of the article {data-id="title"} + +`; + const {contents} = renderDefault(imageMd); + t.deepEqual(parse(contents), parse('

Title of the article

')); +}); + test('emphasis and strong', t => { const emphasis = 'Hey ! *That looks cool*{style="color: blue;"} ! No, that\'s **not**{.not} !'; const {contents} = renderDefault(emphasis); -- cgit v1.2.3