Project

General

Profile

Defect #31695 » fix_for_links_without_href.patch

Marius BĂLTEANU, 2019-11-04 21:11

View differences:

lib/redmine/wiki_formatting/markdown/html_parser.rb
'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
lib/redmine/wiki_formatting/textile/html_parser.rb
'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
(3-3/3)