This commit is contained in:
Toks
2013-04-11 15:00:20 -04:00
parent 9982c94f68
commit 06f7f711dd

View File

@@ -27,7 +27,7 @@ module PostsHelper
source_link = link_to(text, post.normalized_source)
source_search = "source:#{text}"
elsif post.source =~ /^http/
text = truncate(post.normalized_source.sub(/^https?:\/\/(?:www)?/, ""))
text = truncate(post.normalized_source.sub(/^https?:\/\/(?:www\.)?/, ""))
source_link = link_to(truncate(text, :length => 20), post.normalized_source)
source_search = "source:#{post.source.sub(/[^\/]*$/, "")}"
else