From e09c6e81aabf50a3c6bbf946c2abaee434bfc59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Wed, 13 Mar 2024 13:06:22 +0100 Subject: [PATCH] Fix bug with limiting blocquotes in ExpensiMark --- lib/ExpensiMark.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index 181101ab..129edbf6 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -226,13 +226,13 @@ export default class ExpensiMark { const filterRules = ['heading1']; // if we don't reach the max quote depth we allow the recursive call to process possible quote - if (this.currentQuoteDepth < this.maxQuoteDepth) { + if (this.currentQuoteDepth < this.maxQuoteDepth - 1) { filterRules.push('quote'); this.currentQuoteDepth++; } const replacedText = this.replace(textToReplace, {filterRules, shouldEscapeText: false, shouldKeepRawInput}); - this.currentQuoteDepth = 1; + this.currentQuoteDepth = 0; return `
${isStartingWithSpace ? ' ' : ''}${replacedText}
`; }, },