From 0fccf79089c13fbe9771313c0d55fcc170221cdf Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Sat, 20 May 2017 15:33:17 +0200 Subject: [PATCH] Default to nofollow if URI parse fails --- extras/markdowner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/markdowner.rb b/extras/markdowner.rb index 901e3e3..ca67d06 100644 --- a/extras/markdowner.rb +++ b/extras/markdowner.rb @@ -27,7 +27,7 @@ class Markdowner # make links have rel=nofollow ng.css("a").each do |h| - h[:rel] = "nofollow" unless URI.parse(h[:href]).host.nil? + h[:rel] = "nofollow" unless (URI.parse(h[:href]).host.nil? rescue false) end ng.at_css("body").inner_html