FIX: Don't allow links with no href

This commit is contained in:
Robin Ward
2018-03-28 12:32:16 -04:00
parent 9e7d5a3cdf
commit 31d0998506
3 changed files with 7 additions and 3 deletions

View File

@@ -111,9 +111,9 @@ class PostAnalyzer
return @raw_links if @raw_links.present?
@raw_links = []
cooked_stripped.css("a[href]").each do |l|
cooked_stripped.css("a").each do |l|
# Don't include @mentions in the link count
next if l['href'].blank? || link_is_a_mention?(l)
next if link_is_a_mention?(l)
@raw_links << l['href'].to_s
end