From 4920042343727c18aea1656a20b2e6f5f42fe5a0 Mon Sep 17 00:00:00 2001 From: logwolvy <18429813+logwolvy@users.noreply.github.com> 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