diff --git a/src/common/mdh-html-to-text.js b/src/common/mdh-html-to-text.js index 746d957c..3d9ff814 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); + // Try to leave intact the links that Gmail adds when tagging someone on an email + this.preprocessInfo.html = this.preprocessInfo.html.replace( + /]+)>([^<]*)<\/a>/ig, + '<a $1>$2<\/a>' + ); + // 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(