FIX: Duplicate a tag if image url is same to href
This commit is contained in:
parent
2e7c61681e
commit
5c11104f9f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue