# HG changeset patch # User Serhii Ilin # Date 2024-01-29 10:23:16 # Node ID 5af2b5176e77e61974c4acc3e641676bf38f6855 # Parent ab333ff0b69cada8e1efa05fe103af4a6907e3ef fix(jupyter): adopted to support more formats. Fixes: RCCE-38 diff --git a/rhodecode/lib/markup_renderer.py b/rhodecode/lib/markup_renderer.py --- a/rhodecode/lib/markup_renderer.py +++ b/rhodecode/lib/markup_renderer.py @@ -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: