From 0dadc79c639439f2d517ab3ad2cbf44dc62f21ff Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 18 Sep 2019 02:03:54 +0200 Subject: Update tests to the new behaviour Related to trailing blank lines at the end of fenced blocks. I spaced a little the code too. --- __tests__/index.js | 3 +++ src/index.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/__tests__/index.js b/__tests__/index.js index cea2eea..f6d265e 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -154,6 +154,7 @@ This is an awesome code `; const {contents} = render(fencedCodeString); t.deepEqual(parse(contents), parse(`
This is an awesome code
+
 
`)); }); @@ -165,6 +166,7 @@ This is an awesome code `; const {contents} = render(fencedCodeString); t.deepEqual(parse(contents), parse(`
This is an awesome code
+
 
`)); }); @@ -176,6 +178,7 @@ This is an awesome code `; const {contents} = render(fencedCodeString); t.deepEqual(parse(contents), parse(`
This is an awesome code
+
 
`)); }); diff --git a/src/index.js b/src/index.js index 2e839e8..6b8a9de 100644 --- a/src/index.js +++ b/src/index.js @@ -79,11 +79,13 @@ function tokenizeGenerator(prefix, oldParser, config) { } } } + eaten = eat(prefix + parsedAttr.eaten)(eaten); } return eaten; } + // Return the new tokenizer function return token; } @@ -130,6 +132,7 @@ function filterAttributes(prop, config, type) { } else { inScope = x => !isDangerous(x); } + break; case 'extended': default: @@ -206,6 +209,7 @@ function tokenizeFencedCode(oldParser, config) { } } } + if (parsedByCustomAttr) { eaten = eat(prefix + parsedAttr.eaten)(eaten); } -- cgit v1.2.3