lib/awesome_bot/links.rb in awesome_bot-1.13.7 vs lib/awesome_bot/links.rb in awesome_bot-1.13.8

- old
+ new

@@ -9,11 +9,19 @@ .map do |x| if x.include? ')]' x.gsub /\)\].*/, '' elsif (x.scan(')').count == 2) && (x.scan('(').count == 1) x.gsub(/\)\).*/, ')') - elsif (x.scan(')').count > 0) && !(x.include? 'wikipedia') - x.gsub(/\).*/, '') + elsif (x.scan(')').count > 0) + if (x.include? 'wikipedia') + if (x.scan(')').count == 1) && (x.scan('(').count == 0) + x.sub(')','') + else + x + end + else + x.gsub(/\).*/, '') + end elsif x.include? '[' # adoc x.gsub(/\[.*/, '') elsif x[-1]=='.' || x[-1]==':' x[0..-2] elsif x[-1]=='.'