From 0a1eada8dc3c59e7776c4a4873545d710f7c3868 Mon Sep 17 00:00:00 2001 From: Gal Falkon <> Date: Sat, 27 Nov 2021 21:33:44 +0200 Subject: [PATCH] Fix #676: Trying to keep current formatting intact --- src/common/mdh-html-to-text.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/mdh-html-to-text.js b/src/common/mdh-html-to-text.js index 746d957c..bc12408f 100644 --- a/src/common/mdh-html-to-text.js +++ b/src/common/mdh-html-to-text.js @@ -105,6 +105,12 @@ MdhHtmlToText.prototype._preprocess = function() { // to remain intact. this.excludeTagBlocks('blockquote', true); + // Trying to keep current formatting intact (see issue #676) + this.preprocessInfo.html = this.preprocessInfo.html.replace( + /<(\/)?(b|i|u|strike)>/ig, + '<$1$2>' + ); + // Try to leave intact the line that Gmail adds that says: // On such-a-date, such-a-person wrote: this.preprocessInfo.html = this.preprocessInfo.html.replace(