mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-17 06:54:27 -06:00
Merge pull request #358 from souljuse/master
Add support for RTL languages
This commit is contained in:
commit
534e2cadee
@ -206,6 +206,7 @@ easyMDE.value('New input for **EasyMDE**');
|
||||
- **theme**: Override the theme. Defaults to `easymde`.
|
||||
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
||||
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
||||
- **direction**: `rtl` or `ltr`. Changes text direction to support right-to-left languages. Defaults to `ltr`.
|
||||
|
||||
|
||||
### Options example
|
||||
|
@ -2,6 +2,10 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.CodeMirror-rtl pre {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.EasyMDEContainer.sided--no-fullscreen {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
@ -1768,6 +1768,8 @@ function EasyMDE(options) {
|
||||
|
||||
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
|
||||
options.minHeight = options.maxHeight;
|
||||
@ -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') || '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user