From 2e8f2ae55ec387b05f680540b15f02df8f56ccb4 Mon Sep 17 00:00:00 2001 From: logwolvy Date: Mon, 22 Jan 2018 02:26:04 +0530 Subject: [PATCH] fix nil output name 'a' tags --- lib/html2text.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/html2text.rb b/lib/html2text.rb index f5126d0..06be4ab 100644 --- a/lib/html2text.rb +++ b/lib/html2text.rb @@ -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