diff --git a/IPython/html/static/notebook/js/widgets/button.js b/IPython/html/static/notebook/js/widgets/button.js index de4759e00..bea17eb5d 100644 --- a/IPython/html/static/notebook/js/widgets/button.js +++ b/IPython/html/static/notebook/js/widgets/button.js @@ -38,8 +38,8 @@ define(["notebook/js/widget"], function(){ // Frontent -> Frontend Sync update : function(){ var description = this.model.get('description'); - description = description.replace(' ', ' '); - description = description.replace('\n', '
\n'); + description = description.replace(/ /g, ' ', 'm'); + description = description.replace(/\n/g, '
\n', 'm'); if (description.length == 0) { this.$el.html(' '); // Preserve button height } else { diff --git a/IPython/html/static/notebook/js/widgets/selection.js b/IPython/html/static/notebook/js/widgets/selection.js index 3bd0a8fb4..e5ae5a385 100644 --- a/IPython/html/static/notebook/js/widgets/selection.js +++ b/IPython/html/static/notebook/js/widgets/selection.js @@ -60,8 +60,8 @@ define(["notebook/js/widget"], function(){ update : function(){ var selected_item_text = this.model.get('value'); - selected_item_text = selected_item_text.replace(' ', ' '); - selected_item_text = selected_item_text.replace('\n', '
\n'); + selected_item_text = selected_item_text.replace(/ /g, ' '); + selected_item_text = selected_item_text.replace(/\n/g, '
\n'); if (selected_item_text.length == 0) { this.$droplabel.html(' '); } else {