mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Display safe HTML+SVG even if untrusted, but don't set trusted=1.
This commit is contained in:
parent
31c9e08fa8
commit
3b262912a1
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user