diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js
index 39f61e8..9a8e848 100644
--- a/IPython/frontend/html/notebook/static/js/notebook.js
+++ b/IPython/frontend/html/notebook/static/js/notebook.js
@@ -118,7 +118,7 @@ var IPython = (function (IPython) {
// Execute code cell, and insert new in place
that.execute_selected_cell();
// Only insert a new cell, if we ended up in an already populated cell
- if (that.get_selected_cell().toJSON().input !== "") {
+ if (/\S/.test(that.get_selected_cell().toJSON().input) == true) {
that.insert_cell_above('code');
}
return false;