check for html tags and append "%html "

This commit is contained in:
Prabhjyot Singh 2016-04-01 15:58:47 +05:30
parent c58eae7b33
commit 756558ed90

View file

@ -223,8 +223,15 @@ public class LivyHelper {
return new InterpreterResult(Code.ERROR, errorMessage.toString());
}
if (((Map) jsonMap.get("output")).get("status").equals("ok")) {
return new InterpreterResult(Code.SUCCESS,
(String) ((Map) ((Map) jsonMap.get("output")).get("data")).get("text/plain"));
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;
}
return new InterpreterResult(Code.SUCCESS, result);
}
}
return null;