fix(jupyter): adopted to support more formats. Fixes: RCCE-38
This commit is contained in:
parent
38c00aa2be
commit
79aeb82ee8
1 changed files with 2 additions and 2 deletions
|
|
@ -449,7 +449,7 @@ class MarkupRenderer(object):
|
|||
cell.source = cls.sanitize_html(cell.source)
|
||||
return cell, resources
|
||||
|
||||
for cell_output in cell.outputs:
|
||||
for cell_output in cell.get('outputs', []):
|
||||
if 'data' in cell_output:
|
||||
if 'application/javascript' in cell_output['data']:
|
||||
cell_output['data']['text/plain'] = sandbox_text
|
||||
|
|
@ -553,7 +553,7 @@ class MarkupRenderer(object):
|
|||
else:
|
||||
try:
|
||||
body, _ = as_html(notebook)
|
||||
except AttributeError:
|
||||
except (AttributeError, nbformat.ValidationError):
|
||||
try:
|
||||
nbformat.validate(nbformat.reader.reads(source))
|
||||
except nbformat.ValidationError as exc:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue