FIX: extract links in post processor

when oneboxes are not cached or are refreshed they can introduce new
links, these links must be extracted otherwise you can not follow them
This commit is contained in:
Sam
2016-04-12 12:28:18 +10:00
parent cb6d1632ba
commit 22b2f5285c
4 changed files with 24 additions and 3 deletions

View File

@@ -29,9 +29,16 @@ class CookedPostProcessor
optimize_urls
pull_hotlinked_images(bypass_bump)
grant_badges
extract_links
end
end
# onebox may have added some links, so extract them now
def extract_links
TopicLink.extract_from(@post)
QuotedPost.extract_from(@post)
end
def has_emoji?
(@doc.css("img.emoji") - @doc.css(".quote img")).size > 0
end