Skip to content

Commit 28fc9b2

Browse files
committed
Always return html preview in case of pure text
1 parent e8ed8dd commit 28fc9b2

File tree

2 files changed

+105
-139
lines changed

2 files changed

+105
-139
lines changed

notebook/r/note.json

Lines changed: 103 additions & 136 deletions
Large diffs are not rendered by default.

spark/src/main/java/org/apache/zeppelin/spark/SparkRInterpreter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,11 @@ private String format(String html, String imageWidth) {
132132
Document document = Jsoup.parse(html);
133133

134134
Element body = document.getElementsByTag("body").get(0);
135+
135136
Elements images = body.getElementsByTag("img");
136137
Elements scripts = body.getElementsByTag("script");
137-
Elements paragraphs = body.getElementsByTag("p");
138138

139-
if ((paragraphs.size() == 1)
140-
&& (images.size() == 0)
139+
if ((images.size() == 0)
141140
&& (scripts.size() == 0)) {
142141

143142
// We are here with a pure text output, let's keep format intact...

0 commit comments

Comments
 (0)