diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-18 20:15:56 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-11-18 23:00:47 +0300 |
commit | e126406befebd5017d28c858bb357dd694abe774 (patch) | |
tree | 3a261174e1f98e94eec6dddb7172fb6dfeb41d7b /Gemfile.lock | |
parent | 153c499aeeff55c28fec6824f92ad9b2d7dab508 (diff) |
Merge branch 'bugfix/html-only-mail' into 'master'
add parsing support for incoming html email
## What does this MR do?
Fixes #18388 by adding support for parsing HTML email
## Are there points in the code the reviewer needs to double check?
The new class, Gitlab::Email::HTMLParser, which needs to translate the HTML content to text and also delete replies, as they are not necessarily in the correct format to be caught by EmailReplyParser. The solution I found that should work for any HTML-formatted email is to remove all `<table>` and `<blockquote>` tags. Actual `<table>` elements (to be interpreted by markdown) should already be encoded with e.g. `<table>` - the only failure mode is if there is an *actual* HTML table in the content itself, which we wouldn't be able to support easily anyways.
The gem `html2text` traverses the HTML tree and outputs text - and markdown in the case of HTML links or images.
See merge request !7397
Diffstat (limited to 'Gemfile.lock')
-rw-r--r-- | Gemfile.lock | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 81b43f2238a..e5448961a1e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -345,6 +345,8 @@ GEM html-pipeline (1.11.0) activesupport (>= 2) nokogiri (~> 1.4) + html2text (0.2.0) + nokogiri (~> 1.6) htmlentities (4.3.4) httparty (0.13.7) json (~> 1.8) @@ -881,6 +883,7 @@ DEPENDENCIES health_check (~> 2.2.0) hipchat (~> 1.5.0) html-pipeline (~> 1.11.0) + html2text httparty (~> 0.13.3) influxdb (~> 0.2) jira-ruby (~> 1.1.2) |