Skip to content

Commit

Permalink
Do not try to overly escape the notebook version info anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Aug 16, 2019
1 parent 228ee91 commit f655977
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions jupyterlab/extension.py
Expand Up @@ -141,13 +141,9 @@ def load_jupyter_server_extension(nbapp):
page_config['devMode'] = dev_mode
page_config['token'] = nbapp.token

# Export the version info tuple to a JSON array. This gets printed
# inside double quote marks, so we render it to a JSON string of the
# JSON data (so that we can call JSON.parse on the frontend on it).
# We also have to wrap it in `Markup` so that it isn't escaped
# by Jinja. Otherwise, if the version has string parts these will be
# escaped and then will have to be unescaped on the frontend.
page_config['notebookVersion'] = Markup(dumps(dumps(version_info))[1:-1])
# Client-side code assumes notebookVersion is a JSON-encoded string
# TODO: fix this when we can make such a change
page_config['notebookVersion'] = dumps(version_info)

if nbapp.file_to_run and type(nbapp).__name__ == "LabApp":
relpath = os.path.relpath(nbapp.file_to_run, nbapp.notebook_dir)
Expand Down

0 comments on commit f655977

Please sign in to comment.