Skip to content

Commit 2ac0ff3

Browse files
authored
add codemirror-rtl to rtl markdown cells (#5037)
1 parent 80fc3c8 commit 2ac0ff3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

notebook/static/notebook/js/textcell.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define([
1313
'components/marked/lib/marked',
1414
'codemirror/lib/codemirror',
1515
'codemirror/mode/gfm/gfm',
16-
'notebook/js/codemirror-ipythongfm'
16+
'notebook/js/codemirror-ipythongfm',
17+
'bidi/bidi'
1718
], function(
1819
$,
1920
utils,
@@ -26,7 +27,8 @@ define([
2627
marked,
2728
CodeMirror,
2829
gfm,
29-
ipgfm
30+
ipgfm,
31+
bidi
3032
) {
3133
"use strict";
3234
function encodeURIandParens(uri){return encodeURI(uri).replace('(','%28').replace(')','%29')}
@@ -300,7 +302,8 @@ define([
300302

301303
MarkdownCell.options_default = {
302304
cm_config: {
303-
mode: 'ipythongfm'
305+
mode: 'ipythongfm',
306+
direction: bidi.isMirroringEnabled() ? 'rtl' : 'ltr'
304307
},
305308
placeholder: "Type *Markdown* and LaTeX: $\\alpha^2$"
306309
};

0 commit comments

Comments
 (0)