mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Always return html preview in case of pure text
This commit is contained in:
parent
a0306fc019
commit
35486c7052
2 changed files with 123 additions and 157 deletions
File diff suppressed because one or more lines are too long
|
|
@ -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...
|
||||
|
|
|
|||
Loading…
Reference in a new issue