From f06aca718a47c962225f717ac0ff303decc67204 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 3 Feb 2017 14:49:23 -0800 Subject: [PATCH] Wrap prompts in bdi for rtl layout --- notebook/static/notebook/js/codecell.js | 2 +- notebook/static/notebook/js/outputarea.js | 9 ++++++++- notebook/tests/notebook/prompt_numbers.js | 12 ++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 54781cf6f8..d7dabc2a32 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -465,7 +465,7 @@ define([ } else { ns = encodeURIComponent(prompt_value); } - return 'In [' + ns + ']:'; + return 'In [' + ns + ']:'; }; CodeCell.input_prompt_continuation = function (prompt_value, lines_number) { diff --git a/notebook/static/notebook/js/outputarea.js b/notebook/static/notebook/js/outputarea.js index 4d14cf4d37..33a5ffa89b 100644 --- a/notebook/static/notebook/js/outputarea.js +++ b/notebook/static/notebook/js/outputarea.js @@ -455,7 +455,14 @@ define([ var toinsert = this.create_output_area(); this._record_display_id(json, toinsert); if (this.prompt_area) { - toinsert.find('div.prompt').addClass('output_prompt').text('Out[' + n + ']:'); + toinsert.find('div.prompt') + .addClass('output_prompt') + .empty() + .append( + $('').text('Out') + ).append( + '[' + n + ']:' + ); } var inserted = this.append_mime_type(json, toinsert); if (inserted) { diff --git a/notebook/tests/notebook/prompt_numbers.js b/notebook/tests/notebook/prompt_numbers.js index 21e6acd278..b4ca03e660 100644 --- a/notebook/tests/notebook/prompt_numbers.js +++ b/notebook/tests/notebook/prompt_numbers.js @@ -21,16 +21,16 @@ casper.notebook_test(function () { var a = 'print("a")'; var index = this.append_cell(a); - this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is   by default"); + this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is   by default"); set_prompt(index, 2); - this.test.assertEquals(get_prompt(index), "In [2]:", "prompt number is 2"); + this.test.assertEquals(get_prompt(index), "In [2]:", "prompt number is 2"); set_prompt(index, 0); - this.test.assertEquals(get_prompt(index), "In [0]:", "prompt number is 0"); + this.test.assertEquals(get_prompt(index), "In [0]:", "prompt number is 0"); set_prompt(index, "*"); - this.test.assertEquals(get_prompt(index), "In [*]:", "prompt number is *"); + this.test.assertEquals(get_prompt(index), "In [*]:", "prompt number is *"); set_prompt(index, undefined); - this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  "); + this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  "); set_prompt(index, null); - this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  "); + this.test.assertEquals(get_prompt(index), "In [ ]:", "prompt number is  "); }); });