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}
`; }, },