Always return html preview in case of pure text

This commit is contained in:
Eric Charles 2016-02-13 12:37:28 +01:00
parent a0306fc019
commit 35486c7052
2 changed files with 123 additions and 157 deletions

File diff suppressed because one or more lines are too long

View file

@ -132,12 +132,11 @@ public class SparkRInterpreter extends Interpreter {
Document document = Jsoup.parse(html);
Element body = document.getElementsByTag("body").get(0);
Elements images = body.getElementsByTag("img");
Elements scripts = body.getElementsByTag("script");
Elements paragraphs = body.getElementsByTag("p");
if ((paragraphs.size() == 1)
&& (images.size() == 0)
if ((images.size() == 0)
&& (scripts.size() == 0)) {
// We are here with a pure text output, let's keep format intact...