##// END OF EJS Templates
Backport PR #6653: Fix IPython.utils.ansispan() to ignore stray [0m...
Backport PR #6653: Fix IPython.utils.ansispan() to ignore stray [0m Previously, `IPython.utils.fixConsole("\033[0m")` (I use `fixConsole()` because `ansispan()` is private) gave `"</span>"`. I also changed `ansiyellow` to something that looks actually yellow (but still dark). I'm submitting this to `master`, but it would be good to backport this to 2.x (whatever the procedure is).

File last commit:

r15201:029ac024
r20381:96f47674
Show More
inject_js.js
23 lines | 648 B | application/javascript | JavascriptLexer
//
// Test robustness about JS injection in different place
//
// This assume malicious document arrive to the frontend.
//
casper.notebook_test(function () {
var messages = [];
this.on('remote.alert', function (msg) {
messages.push(msg);
});
this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
var json = cell.toJSON();
json.prompt_number = "<script> alert('hello from input prompts !')</script>";
cell.fromJSON(json);
});
this.then(function () {
this.test.assert(messages.length == 0, "Captured log message from script tag injection !");
});
});