2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-08-11 19:22:45 -06:00

Support rtl languages by adding a direction option

This commit is contained in:
Irene Oppo 2021-09-28 17:22:30 +02:00 committed by Irene Oppo
parent 0f559258c5
commit 53223c4de0
2 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,10 @@
display: block;
}
.CodeMirror-rtl pre {
direction: rtl;
}
.EasyMDEContainer.sided--no-fullscreen {
display: flex;
flex-direction: row;

View File

@ -1767,6 +1767,8 @@ function EasyMDE(options) {
options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
options.maxHeight = options.maxHeight || undefined;
options.direction = options.direction || 'ltr';
if (typeof options.maxHeight !== 'undefined') {
// Min and max height are equal if maxHeight is set
@ -2080,6 +2082,7 @@ EasyMDE.prototype.render = function (el) {
lineNumbers: (options.lineNumbers === true) ? true : false,
autofocus: (options.autofocus === true) ? true : false,
extraKeys: keyMaps,
direction: options.direction,
lineWrapping: (options.lineWrapping === false) ? false : true,
allowDropFileTypes: ['text/plain'],
placeholder: options.placeholder || el.getAttribute('placeholder') || '',