From 2192d1f35e3291679e0977995d86df84cf14b93f Mon Sep 17 00:00:00 2001 From: BrtqKr Date: Wed, 12 Jun 2024 00:03:14 +0200 Subject: [PATCH] update parser --- lib/ExpensiMark.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index afc4bcad..ae4607bf 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -983,7 +983,10 @@ export default class ExpensiMark { // We only want to modify lines starting with > that is not codefence if (Str.startsWith(textSplitted[i], '>') && !insideCodefence) { - textToFormat += `${textSplitted[i]}\n`; + if (textSplitted[i] === '>') { + textToFormat += `${textSplitted[i]} \n`; + insideCodefence = true; + } else textToFormat += `${textSplitted[i]}\n`; } else { // Make sure we will only modify if we have Text needed to be formatted for quote if (textToFormat !== '') { @@ -1029,7 +1032,9 @@ export default class ExpensiMark { if (textToCheck.match(regex)) { // Remove '>' and trim the spaces between nested quotes const formatRow = (row) => { - const quoteContent = row[4] === ' ' ? row.substr(5) : row.substr(4); + let quoteContent = row[4] === ' ' ? row.substr(5) : row.substr(4); + if (row === '> ') quoteContent = row.substr(4); + if (quoteContent.trimStart().startsWith('>')) { return quoteContent.trimStart(); }