From 042d7eb4819a4d3a111f08b2c2a7a42292d2d673 Mon Sep 17 00:00:00 2001 From: Mohammad Farzan Date: Thu, 7 Nov 2019 05:04:27 +0330 Subject: [PATCH] add codemirror-rtl to rtl markdown cells --- notebook/static/notebook/js/textcell.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/notebook/static/notebook/js/textcell.js b/notebook/static/notebook/js/textcell.js index c844d50848..24e02abf85 100644 --- a/notebook/static/notebook/js/textcell.js +++ b/notebook/static/notebook/js/textcell.js @@ -13,7 +13,8 @@ define([ 'components/marked/lib/marked', 'codemirror/lib/codemirror', 'codemirror/mode/gfm/gfm', - 'notebook/js/codemirror-ipythongfm' + 'notebook/js/codemirror-ipythongfm', + 'bidi/bidi' ], function( $, utils, @@ -26,7 +27,8 @@ define([ marked, CodeMirror, gfm, - ipgfm + ipgfm, + bidi ) { "use strict"; function encodeURIandParens(uri){return encodeURI(uri).replace('(','%28').replace(')','%29')} @@ -300,7 +302,8 @@ define([ MarkdownCell.options_default = { cm_config: { - mode: 'ipythongfm' + mode: 'ipythongfm', + direction: bidi.isMirroringEnabled() ? 'rtl' : 'ltr' }, placeholder: "Type *Markdown* and LaTeX: $\\alpha^2$" };