Markdowner: html doc might have no body

In the case of some bogus markdown, like just "<script>..." text
This commit is contained in:
joshua stein 2017-09-20 09:16:45 -05:00
parent d42685f4e2
commit 1f5d2d4587
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,11 @@ class Markdowner
h[:rel] = "nofollow" unless (URI.parse(h[:href]).host.nil? rescue false)
end
ng.at_css("body").inner_html
if ng.at_css("body")
ng.at_css("body").inner_html
else
""
end
end
def self.walk_text_nodes(node, &block)