split likely multiline strings when writing to/from JSON

MinRK 15 years ago
parent 8d739fb5a2
commit 7519ff3b41

@ -118,7 +118,12 @@ class NotebookManager(LoggingConfigurable):
if format not in self.allowed_formats:
raise web.HTTPError(415, u'Invalid notebook format: %s' % format)
last_modified, nb = self.get_notebook_object(notebook_id)
data = current.writes(nb, format)
kwargs = {}
if format == 'json':
# don't split lines for sending over the wire, because it
# should match the Python in-memory format.
kwargs['split_lines'] = False
data = current.writes(nb, format, **kwargs)
name = nb.get('name','notebook')
return last_modified, name, data

Loading…
Cancel
Save