lib/awesome_bot/links.rb in awesome_bot-1.5.0 vs lib/awesome_bot/links.rb in awesome_bot-1.5.1
- old
+ new
@@ -7,10 +7,12 @@
list.reject { |x| x.length < 9 }
.map do |x|
x.gsub(/'.*/, '').gsub(/,.*/, '').gsub('/:', '/')
end
.map do |x|
- if (x.scan(')').count == 2) && (x.scan('(').count == 1)
+ if x.include? ')]'
+ x.gsub /\)\].*/, ''
+ elsif (x.scan(')').count == 2) && (x.scan('(').count == 1)
x.gsub(/\)\).*/, ')')
elsif x.scan(')').count > 0
x.gsub(/\).*/, '')
else
x