mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: Duplicate a tag if image url is same to href
This commit is contained in:
@ -110,7 +110,10 @@ class CookedPostProcessor
|
|||||||
parent = placeholder.parent
|
parent = placeholder.parent
|
||||||
parent.add_next_sibling(placeholder)
|
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"
|
parent["class"] = "link"
|
||||||
a.add_previous_sibling(parent)
|
a.add_previous_sibling(parent)
|
||||||
|
|
||||||
@ -119,6 +122,7 @@ class CookedPostProcessor
|
|||||||
lspan.add_previous_sibling(create_icon_node("link"))
|
lspan.add_previous_sibling(create_icon_node("link"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
img.remove
|
img.remove
|
||||||
true
|
true
|
||||||
|
Reference in New Issue
Block a user