diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js
index 364d709..6bebcb0 100644
--- a/IPython/html/static/notebook/js/outputarea.js
+++ b/IPython/html/static/notebook/js/outputarea.js
@@ -278,17 +278,18 @@ var IPython = (function (IPython) {
"javascript" : "application/javascript",
};
- OutputArea.prototype.convert_mime_types = function (json, data) {
- if (!data) {
- return json;
- }
- // non-mimetype-keyed metadata used to get dropped here, this code
- // re-injects it into the json.
+ OutputArea.prototype.convert_mime_types = function (data) {
for (var key in data) {
- var rkey = OutputArea.mime_map_r[key] || key;
- json[rkey] = data[key];
+ var json_key = OutputArea.mime_map[key] || key;
+ console.log("converting ", key, "to", json_key)
+ if (json_key !== key) {
+ // move mime-type keys to short name
+ console.log("converting ", key, "to", json_key)
+ data[json_key] = data[key];
+ delete data[key];
+ }
}
- return json;
+ return data;
};
OutputArea.prototype.convert_mime_types_r = function (data) {
@@ -756,10 +757,10 @@ var IPython = (function (IPython) {
// TODO: remove this when we update to nbformat 4
var len = outputs.length;
for (var i=0; i