Repository navigation
#421 Add experiment function RTL support - #439
Conversation
| :style="{ 'color': theme === 'dark' ? darkColor : lightColor, 'lineHeight': lineHeight, 'fontSize': fontSize, | ||
| 'font-family': editorFontFamily ? `${editorFontFamily}, ${defaultFontFamily}` : `${defaultFontFamily}` }" | ||
| 'font-family': editorFontFamily ? `${editorFontFamily}, ${defaultFontFamily}` : `${defaultFontFamily}`, | ||
| 'direction': textDirection }" |
There was a problem hiding this comment.
I think we should use the HTML dir attribute instead of css style. Please see https://stackoverflow.com/a/5375907.
There was a problem hiding this comment.
@fxha OK, I'll use dir attribute for this. Any suggestion about scrollbar position?
There was a problem hiding this comment.
@mrg0lden @mohsenkhanpour What's the default scrollbar side? Is it on the left or right side?
There was a problem hiding this comment.
@fxha @enyaxu The scrollbar is on the default right side on most (almost all) of rtl pages that I have seen. Similar to ltr.
Right is also better because it gives you a unified experience when working with texts of several languages.
You don't want to look again for your scrollbar when you switch between files written in different languages.
|
Nice PR, great thanks for you , I'll review this evening. |
|
Yes,when set up **dir** attitube to **rtl**, It’s deafult change sildebar
position to left!
|
|
Does using the HTML |
|
@mohsenkhanpour You can pull down this PR, and test locally. |
@enyaxu I think you can set the scrollbar direction via css to the right. |
|
@Jocs @fxha @enyaxu ✅ 2. The scrollbar is to the left and the slidebar is to the left. ❎ 3. The line direction argument applies to the next opened file rather than the open document. ❎ 4. The source code viewer still in ltr, (this can be done and very useful if implemented) ❎ 5. No padding makes the first words in each line difficult to read: |
Maybe you need to look up codemirror's documents and to see weather it support |
|
@Jocs @mohsenkhanpour |
|
@mohsenkhanpour |
For now I'm reading the source code. I can't find a way to attach and save attribute with each single file. So I just used preference to save |
Should we need to change this to left or remain it? |
ok
I usually don't use right-to-left writing, so I'm not sure about the position of the scrollbar. I can only give some suggestions on the code. can @mohsenkhanpour give some advice? |
As we discussed in the issue before, the |
|
@enyaxu I tested the pull request. Here is what I found:
|
|
@mohsenkhanpour |
|
@mohsenkhanpour @Jocs
Above bugs are fixed.
For this, you can see my upload image, I think don't need to added margins. I tested from mac. Also, I found Travis CI check failed, I check error like below.
@Jocs Seems ext config for macosx has some error. |
|
Beautiful. I will pull and test as soon as I can. Thanks for your time and effort. |
|
@enyaxu If you change the direction from LTR to RTL and back the direction attribute has conflicting values and stays RTL. |
|
@fxha The |
|
@enyaxu OK then the problem lies somewhere else because you cannot change the direction after setting it to RTL at runtime. |
|
@enyaxu Sorry, this PR has dragged on for so long. One reason is that I don't know much about RTL input. Another reason is that I am really busy recently. I just reviewed the code and ran it locally, with some questions.
|
|
@Jocs I have been using this PR for some days and I have also given a copy to one of my friends who writes rtl text for his Jekyll blog. What's that header tag? I haven't noticed it in my texts? |
|
@mohsenkhanpour If you cursor is in the active header paragraph, and the header tag will be shown on the left (ltr). |
|
@Jocs It looks all good. If there is anything specific that you want me to test I can do that. |
|
@mohsenkhanpour @enyaxu @fxha thank you all for this new feature, 👍 |
* chore(deps): bump dompurify to ^3.4.9 across desktop/muya/muyajs Updates the HTML sanitizer from ^3.4.3/^3.4.5 to ^3.4.9 (resolves to 3.4.11), deduping the two installed versions (3.4.3 + 3.4.7) into one. Clears Dependabot alerts #443/#451/#452/#453/#454/#455/#456. MarkText calls DOMPurify.sanitize() only with string input and RETURN_TRUSTED_TYPE: false (no IN_PLACE/RETURN_DOM/addHook/ SAFE_FOR_TEMPLATES), so none of these CVEs were reachable; the bump is defense-in-depth for the editor's HTML sanitization path. DOMPurify 3.4.8+ hardened cross-realm namespace validation, which the happy-dom test environment does not satisfy: under happy-dom it strips every element, even default-allowed tags like <p>/<h1>. Real Chromium/Electron is unaffected (verified: jsdom, which matches production DOM behavior, sanitizes correctly). Move the five DOMPurify-dependent muya specs to the jsdom environment and declare jsdom as a muya devDependency. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * chore(deps): bump happy-dom to ^20.8.9 in muya Updates muya's vitest DOM test environment from ^15.11.7 to ^20.8.9 (resolves to 20.10.6). Clears Dependabot alerts #426/#427/#428/#434/#437/#438 (2 critical "VM context escape / RCE", 4 high). happy-dom is a devDependency used only as the unit-test DOM; it is never bundled into the shipped app, and the muya suites run trusted fixtures, so these CVEs were not reachable. The bump keeps the test toolchain current and clears the critical badges. The full muya unit suite (143 files) passes on 20.x — the DOMPurify-dependent specs already moved to jsdom in the previous commit. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * chore(deps): update vite to patched 7.3.5 / 8.0.16 Bumps vite to the patched releases across the workspace (desktop ^7.3.5, muya + muya-e2e ^8.0.16), updating the declared floors so installs can't regress below the fix. Clears Dependabot alerts #441/#442/#447/#448 (server.fs.deny bypass + launch-editor NTLMv2 disclosure — both Windows dev-server only; vite is build tooling, never shipped to users). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * chore(deps): pin transitive deps to patched versions via pnpm overrides Adds range-scoped pnpm.overrides to force patched releases of the transitive dependencies Dependabot flagged, while leaving unaffected older majors in place (undici 6.x, esbuild 0.25.x, js-yaml 3.x): form-data 4.0.5 -> 4.0.6 (#450 CRLF injection) tmp 0.2.5 -> 0.2.6 (#411 path traversal) tar 7.5.15 -> 7.5.16 (#449 PAX file smuggling) ws 8.20.1 -> 8.21.0 (#444 memory-exhaustion DoS) undici 7.24/7.25 -> 7.28.0 (#457 SOCKS5 TLS bypass; keeps 6.25.0) esbuild 0.27/0.28.0-> 0.28.1 (#439 dev-server file read; keeps 0.25.x) @babel/core 7.29.0 -> 7.29.6 (#445 sourceMappingURL file read) js-yaml 4.1.1 -> 4.2.0 (#446 merge-key DoS; keeps 3.14.2) All are build/test/website tooling reachable only on developer/CI machines, never bundled into the shipped app. js-yaml 3.14.2 remains via the website's gray-matter (no 3.x patch exists); it parses only trusted first-party content, so #446 is not exploitable there and will be dismissed on GitHub. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
* feature: Add experiment RTL support * fix: binding to currentfile textdirection * feature: add sourcecode RTL support * feature: add text direction menu upgrade * fix sourceCode does't change from menu switch text direction









Description
Add experiment function for text direction RTL support
--