Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ef39fb0b
Commit
ef39fb0b
authored
Feb 06, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unwrap all links with no href
parent
d866c776
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
lib/gitlab/email/html_parser.rb
lib/gitlab/email/html_parser.rb
+7
-0
No files found.
lib/gitlab/email/html_parser.rb
View file @
ef39fb0b
...
...
@@ -17,6 +17,13 @@ module Gitlab
def
filter_replies!
document
.
xpath
(
'//blockquote'
).
each
(
&
:remove
)
document
.
xpath
(
'//table'
).
each
(
&
:remove
)
# bogus links with no href are sometimes added by outlook,
# and can result in Html2Text adding extra square brackets
# to the text, so we unwrap them here.
document
.
xpath
(
'//a[not(@href)]'
).
each
do
|
link
|
link
.
replace
(
link
.
children
)
end
end
def
filtered_html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment