From 5a60141bed2319b45d49469b45edbe5b2bcbcd4d Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 17 Oct 2013 14:31:20 -0700 Subject: [PATCH] use splitext in notebook_list fixes case where notebooks with '.' in name were misrendered --- IPython/html/static/tree/js/notebooklist.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index a29d40cec..8536ae531 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -69,10 +69,10 @@ var IPython = (function (IPython) { var f = files[i]; var reader = new FileReader(); reader.readAsText(f); - var fname = f.name.split('.'); - var nbname = fname.slice(0,-1).join('.'); - var file_ext = fname.slice(-1)[0]; - if (file_ext === 'ipynb') { + var name_and_ext = utils.splitext(f.name); + var nbname = name_and_ext[0]; + var file_ext = name_and_ext[-1]; + if (file_ext === '.ipynb') { var item = that.new_notebook_item(0); that.add_name_input(nbname, item); // Store the notebook item in the reader so we can use it later @@ -174,7 +174,7 @@ var IPython = (function (IPython) { for (var i=0; i