Show More
@@ -436,12 +436,20 b' class MarkupRenderer(object):' | |||
|
436 | 436 | def preprocess(self, nb, resources): |
|
437 | 437 | sandbox_text = 'SandBoxed(IPython.core.display.Javascript object)' |
|
438 | 438 | for cell in nb['cells']: |
|
439 |
if safe |
|
|
439 | if not safe: | |
|
440 | continue | |
|
441 | ||
|
442 | if 'outputs' in cell: | |
|
440 | 443 | for cell_output in cell['outputs']: |
|
441 | 444 | if 'data' in cell_output: |
|
442 | 445 | if 'application/javascript' in cell_output['data']: |
|
443 | 446 | cell_output['data']['text/plain'] = sandbox_text |
|
444 | 447 | cell_output['data'].pop('application/javascript', None) |
|
448 | ||
|
449 | if 'source' in cell and cell['cell_type'] == 'markdown': | |
|
450 | # sanitize similar like in markdown | |
|
451 | cell['source'] = cls.bleach_clean(cell['source']) | |
|
452 | ||
|
445 | 453 | return nb, resources |
|
446 | 454 | |
|
447 | 455 | def _sanitize_resources(resources): |
General Comments 0
You need to be logged in to leave comments.
Login now