Skip to content

Commit c1b49e5

Browse files
committed
Added Syriac
1 parent be9dde3 commit c1b49e5

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This plugin adds configurable RTL support for [Obsidian](https://obsidian.md).
77
It relies on the RTL support of [CodeMirror](https://codemirror.net/doc/manual.html), which is the editor component that Obsidian uses, and contains lots of custom code on top of it to provide a smooth experience within Obsidian.
88
You can set a global direction per file (LTR/RTL) or use Auto which decides on each line individually based on the first strongly-directional character.
99

10-
This is the real deal: Arabic, Hebrew and Persian (Farsi) can be combined with LTR languages freely and render just as you'd expect.
10+
This is the real deal: Arabic, Hebrew, Persian (Farsi), Syriac and Thaana can be combined with LTR languages freely and render just as you'd expect.
1111

1212
To my best knowledge, this is the most comprehensive RTL support any Markdown editor currently has to offer.
1313
Many editors offer RTL support as a global setting rather than a per-document setting -- while this plugin supports both a per-document global LTR/RTL setting and an Auto mode that can mix many directions in the same note.
@@ -79,6 +79,13 @@ It is possible to temporarily override a note's direction regardless of the fron
7979

8080
## Changelog
8181

82+
### 1.1.1
83+
84+
**Bug fixes:**
85+
86+
- Fix to tags in RTL mode (https://github.com/esm7/obsidian-rtl/issues/54), thanks @zoli!
87+
- Added proper support for Syriac and Thaana as RTL languages (https://github.com/esm7/obsidian-rtl/issues/56).
88+
8289
### 1.1.0
8390

8491
**Added full support for RTL, LTR and Auto direction in Canvas**. See [here](#canvas-support) for more details.

globals.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export const AUTO_CLASS = 'is-auto';
44

55
// Based on the Unicode Scripts section of:
66
// https://www.regular-expressions.info/unicode.html
7-
// Basically Arabic and Hebrew character classes are considered RTL (group 1) and all the others are considered LTR.
8-
const STRONG_DIR_REGEX = /(?:([\p{sc=Arabic}\p{sc=Hebrew}])|([\p{sc=Armenian}\p{sc=Bengali}\p{sc=Bopomofo}\p{sc=Braille}\p{sc=Buhid}\p{sc=Canadian_Aboriginal}\p{sc=Cherokee}\p{sc=Cyrillic}\p{sc=Devanagari}\p{sc=Ethiopic}\p{sc=Georgian}\p{sc=Greek}\p{sc=Gujarati}\p{sc=Gurmukhi}\p{sc=Han}\p{sc=Hangul}\p{sc=Hanunoo}\p{sc=Hiragana}\p{sc=Inherited}\p{sc=Kannada}\p{sc=Katakana}\p{sc=Khmer}\p{sc=Lao}\p{sc=Latin}\p{sc=Limbu}\p{sc=Malayalam}\p{sc=Mongolian}\p{sc=Myanmar}\p{sc=Ogham}\p{sc=Oriya}\p{sc=Runic}\p{sc=Sinhala}\p{sc=Syriac}\p{sc=Tagalog}\p{sc=Tagbanwa}\p{sc=Tamil}\p{sc=Telugu}\p{sc=Thaana}\p{sc=Thai}\p{sc=Tibetan}\p{sc=Yi}]))/u;
7+
// Basically Arabic, Hebrew, Syriac and Thaana character classes are considered RTL (group 1) and all the
8+
// others are considered LTR.
9+
const STRONG_DIR_REGEX = /(?:([\p{sc=Arabic}\p{sc=Hebrew}\p{sc=Syriac}\p{sc=Thaana}])|([\p{sc=Armenian}\p{sc=Bengali}\p{sc=Bopomofo}\p{sc=Braille}\p{sc=Buhid}\p{sc=Canadian_Aboriginal}\p{sc=Cherokee}\p{sc=Cyrillic}\p{sc=Devanagari}\p{sc=Ethiopic}\p{sc=Georgian}\p{sc=Greek}\p{sc=Gujarati}\p{sc=Gurmukhi}\p{sc=Han}\p{sc=Hangul}\p{sc=Hanunoo}\p{sc=Hiragana}\p{sc=Inherited}\p{sc=Kannada}\p{sc=Katakana}\p{sc=Khmer}\p{sc=Lao}\p{sc=Latin}\p{sc=Limbu}\p{sc=Malayalam}\p{sc=Mongolian}\p{sc=Myanmar}\p{sc=Ogham}\p{sc=Oriya}\p{sc=Runic}\p{sc=Sinhala}\p{sc=Tagalog}\p{sc=Tagbanwa}\p{sc=Tamil}\p{sc=Telugu}\p{sc=Thai}\p{sc=Tibetan}\p{sc=Yi}]))/u;
910

1011
export const detectDirection = (s: string): Direction | null => {
1112
const match = s.match(STRONG_DIR_REGEX);

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-rtl",
33
"name": "RTL Support",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"minAppVersion": "0.15.3",
66
"description": "Right to Left (RTL) text direction support for languages like Arabic, Hebrew and Persian (Farsi).",
77
"author": "esm",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-rtl",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "RTL (Right to Left) language support for Obsidian.",
55
"main": "main.js",
66
"scripts": {

styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
right: -16px;
102102
}
103103

104-
/* Styling for tags in rtl */
104+
/* Styling for tags in RTL */
105105
.markdown-source-view.is-rtl .cm-line .cm-hashtag.cm-hashtag-begin,
106106
.markdown-source-view .cm-line[dir="rtl"] .cm-hashtag.cm-hashtag-begin {
107107
border-top-right-radius: var(--tag-radius);

0 commit comments

Comments
 (0)