Display safe HTML+SVG even if untrusted, but don't set trusted=1.

This commit is contained in:
Brian E. Granger 2014-02-04 17:20:13 -08:00 committed by MinRK
parent 31c9e08fa8
commit 3b262912a1

View File

@ -491,12 +491,18 @@ var IPython = (function (IPython) {
if ((json[type] !== undefined) && append) {
if (!this.trusted && !OutputArea.safe_outputs[type]) {
// not trusted show warning and do not display
var content = {
text : "Untrusted " + type + " output ignored.",
stream : "stderr"
var is_safe = false;
if (type==='text/html' || type==='text/svg') {
is_safe = IPython.security.is_safe(json[type]);
}
if (!is_safe) {
var content = {
text : "Untrusted " + type + " output ignored.",
stream : "stderr"
}
this.append_stream(content);
continue;
}
this.append_stream(content);
continue;
}
var md = json.metadata || {};
var toinsert = append.apply(this, [json[type], md, element]);