quentez / talonjs

JavaScript port of the Talon email quote parsing library.
MIT License
15 stars 9 forks source link

Only remove quote if regex not found. #20

Closed evonck closed 5 years ago

evonck commented 5 years ago

This PR is trying to fix bug link to adding a quote messages in your reply.

Instead of starting by removing the quote from gmail, microsoft etc... We first attempt to remove the quote based on the regex. If no regex is found then use the blockquote.

This PR also include some check on the deleteQuotationTags . This is use to make sure we don't remove signature and or text present at the end of the quote thread. In order to do so we try to not remove any code that is at the same level as the found quotation. I added a few test to test for this.

In order to check if the a tag is at the same level as the found splitter. I added a new QuotationInfo, this help us keep in memory of all the tags present in the splitter lines. Once we found all of this tags we know the smallest level of the quote.

Finally this PR is increasing the minimum node and lines, as we don't remove the quote before checking the marked line we need to make sure the limit is high enough to check most of the emails.

New PR to set this as a param will come after this one.