mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Fix that receiving HTML email fails if it contains a link without an href attribute (#31695).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18988 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -37,7 +37,15 @@ module Redmine
|
||||
'h6' => {:pre => "\n\n###### ", :post => "\n\n"},
|
||||
'th' => {:pre => '*', :post => "*\n"},
|
||||
'td' => {:pre => '', :post => "\n"},
|
||||
'a' => lambda {|node| node.content.present? ? %| [#{node.content}](#{node.attributes['href'].value}) | : %| #{node.attributes['href'].value} |}
|
||||
'a' => lambda do |node|
|
||||
if node.content.present? && node.attributes.key?('href')
|
||||
%| [#{node.content}](#{node.attributes['href'].value}) |
|
||||
elsif node.attributes.key?('href')
|
||||
%| #{node.attributes['href'].value} |
|
||||
else
|
||||
node.content
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,7 +37,15 @@ module Redmine
|
||||
'h6' => {:pre => "\n\nh6. ", :post => "\n\n"},
|
||||
'th' => {:pre => '*', :post => "*\n"},
|
||||
'td' => {:pre => '', :post => "\n"},
|
||||
'a' => lambda {|node| node.content.present? ? %| "#{node.content}":#{node.attributes['href'].value} | : %| #{node.attributes['href'].value} |}
|
||||
'a' => lambda do |node|
|
||||
if node.content.present? && node.attributes.key?('href')
|
||||
%| "#{node.content}":#{node.attributes['href'].value} |
|
||||
elsif node.attributes.key?('href')
|
||||
%| #{node.attributes['href'].value} |
|
||||
else
|
||||
node.content
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user