Skip to content

Trying to leave Gmail's "plusreply" links intact #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/common/mdh-html-to-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (class="gmail_plusreply"[^>]+)>([^<]*)<\/a>/ig,
'&lt;a $1&gt;$2&lt;\/a&gt;'
);

// Try to leave intact the line that Gmail adds that says:
// On such-a-date, such-a-person <email addy> wrote:
this.preprocessInfo.html = this.preprocessInfo.html.replace(
Expand Down
2 changes: 1 addition & 1 deletion utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var fs = require('fs');
var file = require('file');
var archiver = require('archiver');
var MetaScript = require('MetaScript');
var MetaScript = require('metascript');


var BASE_DIR = '..';
Expand Down