From b1834dba34ae6614c1c87499777c5190bf30c39e Mon Sep 17 00:00:00 2001 From: Damian Tarnawski Date: Sun, 3 Mar 2024 20:41:30 +0100 Subject: [PATCH] Reset backticks_count on italic code block end --- mds/mds.js | 1 + test.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/mds/mds.js b/mds/mds.js index dd37e15..933ff7b 100644 --- a/mds/mds.js +++ b/mds/mds.js @@ -449,6 +449,7 @@ export function parser_write(p, chunk) { if ('`' === char) { if (pending_with_char.length === p.backticks_count) { p.pending = "" + p.backticks_count = 0 parser_add_text(p) parser_end_token(p) } else { diff --git a/test.js b/test.js index c5b53b3..785fc53 100644 --- a/test.js +++ b/test.js @@ -423,6 +423,20 @@ for (let l = 1; l <= 2; l += 1) { }] ) + test_single_write(c + "Code Inline x2" + c, + c+"a"+c+" "+c+"b"+c, + [{ + type : mds.Token.Paragraph, + children: [{ + type : mds.Token.Code_Inline, + children: ["a"] + }, " ", { + type : mds.Token.Code_Inline, + children: ["b"] + }], + }] + ) + if (l > 1) { const m = '`'.repeat(l - 1)