Skip to content

Commit

Permalink
fix nil output name 'a' tags
Browse files Browse the repository at this point in the history
  • Loading branch information
logwolvy committed Jan 21, 2018
1 parent b77ba6a commit 2e8f2ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/html2text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def wrap_link(node, output)
end

if href.nil?
if !name.nil?
output = "[#{output}]"
if !name.nil? && output.empty?
output = nil
end
else
href = href.to_s
Expand Down

0 comments on commit 2e8f2ae

Please sign in to comment.