diff options
author | ache <ache@ache.one> | 2020-05-05 09:18:17 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2020-05-05 09:18:17 +0200 |
commit | 2f3551ef8ed28203a0969a1f80c84a7d6ecda3c8 (patch) | |
tree | d3e4d928be73aae4b69a8d645ba1d0e3ca7f2a24 | |
parent | Implemente atx header inline (diff) |
More header tests
-rw-r--r-- | __tests__/index.js | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/__tests__/index.js b/__tests__/index.js index cf61dfa..f300553 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -129,35 +129,54 @@ test('link', t => { }); test('header', t => { - const imageMd = ` + const headerMd= ` Title of the article ==================== {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(headerMd); t.deepEqual(parse(contents), parse('<h1 data-id="title">Title of the article</h1>')); }); test('atx header', t => { - const imageMd = ` + const atxHeaderMd = ` # Title of the article {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(atxHeaderMd); t.deepEqual(parse(contents), parse('<h1 data-id="title">Title of the article</h1>')); }); test('atx header inline', t => { - const imageMd = ` -# Title of the article {data-id="title"} + const atxHeaderMd = ` +# Title of the article {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(atxHeaderMd); t.deepEqual(parse(contents), parse('<h1 data-id="title">Title of the article</h1>')); }); +test('atx header inline 2', t => { + const atxHeaderMd = ` +# Title of the article{data-id="title"} + +`; + const {contents} = renderDefault(atxHeaderMd); + t.deepEqual(parse(contents), parse('<h1 data-id="title">Title of the article</h1>')); +}); + +test('header error inline', t => { + const atxHeaderMd = ` +Title of the article {data-id="title"} +====================================== + +`; + const {contents} = renderDefault(atxHeaderMd); + t.deepEqual(parse(contents), parse('<h1>Title of the article {data-id="title"}</h1>')); +}); + test('emphasis and strong', t => { const emphasis = 'Hey ! *That looks cool*{style="color: blue;"} ! No, that\'s **not**{.not} !'; const {contents} = renderDefault(emphasis); |