mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fix append "%html "
This commit is contained in:
parent
756558ed90
commit
dc0a3dc5c0
1 changed files with 8 additions and 8 deletions
|
|
@ -183,10 +183,8 @@ public class LivyHelper {
|
|||
if (stringLines.trim().equals("")) {
|
||||
return new InterpreterResult(Code.SUCCESS, "");
|
||||
}
|
||||
LOGGER.error("stringLines==" + stringLines);
|
||||
Map jsonMap = executeCommand(stringLines, context, userSessionMap);
|
||||
Integer id = ((Double) jsonMap.get("id")).intValue();
|
||||
LOGGER.error("jsonMap==" + jsonMap);
|
||||
InterpreterResult res = getResultFromMap(jsonMap);
|
||||
if (res != null) {
|
||||
return res;
|
||||
|
|
@ -225,11 +223,14 @@ public class LivyHelper {
|
|||
if (((Map) jsonMap.get("output")).get("status").equals("ok")) {
|
||||
String result = (String) ((Map) ((Map) jsonMap.get("output"))
|
||||
.get("data")).get("text/plain");
|
||||
if (result.startsWith("<link")
|
||||
|| result.startsWith("<script")
|
||||
|| result.startsWith("<style")
|
||||
|| result.startsWith("<div")) {
|
||||
result = "%html " + result;
|
||||
if (result != null) {
|
||||
result = result.trim();
|
||||
if (result.startsWith("<link")
|
||||
|| result.startsWith("<script")
|
||||
|| result.startsWith("<style")
|
||||
|| result.startsWith("<div")) {
|
||||
result = "%html " + result;
|
||||
}
|
||||
}
|
||||
return new InterpreterResult(Code.SUCCESS, result);
|
||||
}
|
||||
|
|
@ -291,7 +292,6 @@ public class LivyHelper {
|
|||
response = client.execute(request);
|
||||
}
|
||||
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == 200
|
||||
|| response.getStatusLine().getStatusCode() == 201
|
||||
|| response.getStatusLine().getStatusCode() == 404) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue