Skip to content

Fix output of jupyter notebooks saved in VSCode

What does this MR do?

VSCode uses the newer NBFormat Version 4.1, which allows the output text entry to be a simple string.

The function rawCode assumed NBFormat Version 3.2, which requires the output.text object to be an array.

This commit adds a special handling if the type of output.text is a string, then we don't need to use join() and can just return the string.

Fixes: #212837 (closed)

Screenshots

Output of VSCode generated jupyter notebook now renders correctly

Screenshot_2020-05-05_test_nbformat4_ipynb___master___Administrator_ipython_output_test

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Merge request reports