FIX: Duplicate a tag if image url is same to href

This commit is contained in:
Vinoth Kanan 2017-11-15 17:36:48 +05:30
parent 2e7c61681e
commit 5c11104f9f
1 changed files with 10 additions and 6 deletions

View File

@ -110,7 +110,10 @@ class CookedPostProcessor
parent = placeholder.parent
parent.add_next_sibling(placeholder)
if parent.name == 'a' && parent["href"].present? && url != parent["href"]
if parent.name == 'a' && parent["href"].present?
if url == parent["href"]
parent.remove
else
parent["class"] = "link"
a.add_previous_sibling(parent)
@ -119,6 +122,7 @@ class CookedPostProcessor
lspan.add_previous_sibling(create_icon_node("link"))
end
end
end
img.remove
true