Show More
@@ -436,12 +436,20 b' class MarkupRenderer(object):' | |||||
436 | def preprocess(self, nb, resources): |
|
436 | def preprocess(self, nb, resources): | |
437 | sandbox_text = 'SandBoxed(IPython.core.display.Javascript object)' |
|
437 | sandbox_text = 'SandBoxed(IPython.core.display.Javascript object)' | |
438 | for cell in nb['cells']: |
|
438 | for cell in nb['cells']: | |
439 |
if safe |
|
439 | if not safe: | |
|
440 | continue | |||
|
441 | ||||
|
442 | if 'outputs' in cell: | |||
440 | for cell_output in cell['outputs']: |
|
443 | for cell_output in cell['outputs']: | |
441 | if 'data' in cell_output: |
|
444 | if 'data' in cell_output: | |
442 | if 'application/javascript' in cell_output['data']: |
|
445 | if 'application/javascript' in cell_output['data']: | |
443 | cell_output['data']['text/plain'] = sandbox_text |
|
446 | cell_output['data']['text/plain'] = sandbox_text | |
444 | cell_output['data'].pop('application/javascript', None) |
|
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 | return nb, resources |
|
453 | return nb, resources | |
446 |
|
454 | |||
447 | def _sanitize_resources(resources): |
|
455 | def _sanitize_resources(resources): |
General Comments 0
You need to be logged in to leave comments.
Login now