Skip to content

Add a dir option for right-to-left languages - #129

Closed
ronlobo wants to merge 2 commits into
panphora:mainfrom
ronlobo:feat/rtl
Closed

ronlobo wants to merge 2 commits into
panphora:mainfrom
ronlobo:feat/rtl

Conversation

@ronlobo

@ronlobo ronlobo commented Nov 9, 2026 •

Copy link
Copy Markdown

'rtl' or 'auto' (follow the page) sets the same direction on the container, textarea and preview, so the overlay stays aligned; alignment, and in preview mode lists, task boxes and quote bars, turn to the right. 'ltr' stays the default. Checked in Chromium with Hebrew (monospace) and Arabic (proportional: true).


Summary by cubic

Adds a dir option so the editor can write from right to left. 'rtl' forces right-to-left; excess space'auto' follows the page where the editor sits. Both set the same direction on the container, textarea, and preview so the overlay stays aligned, and preview mode moves list indents, task boxes, and quote bars to the right. The default stays 'ltr'.

  • Hebrew works with monospace fonts; Arabic needs proportional: true since Arabic script has no monospace fonts.
  • Adds the option to the TypeScript definitions and generated types, plus direction tests.
  • Rebuilt dist/ so package and CDN users get the option.

Written for commit cd613dd. Summary will update on new commits.

View guided diff

'rtl' or 'auto' (follow the page) sets the same direction on the container, textarea and preview, so the overlay stays aligned; alignment, and in preview mode lists, task boxes and quote bars, turn to the right. 'ltr' stays the default. Checked in Chromium with Hebrew (monospace) and Arabic (proportional: true).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread README.md Resolved
Comment thread src/overtype.js Resolved
Rebuilt dist/ (npm run build) so package and CDN users get the dir option the README documents; the 'Apply options to the editor' JSDoc moved back above _applyOptions(), the direction one stays above _applyDirection().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ronlobo

ronlobo commented Nov 10, 2026

Copy link
Copy Markdown
Author

Thanks, both fixed. dist/ is rebuilt, so the package and CDN builds include dir (the minified script-tag build sets dir="rtl" from dir:
'auto' on an RTL page), and the _applyOptions() JSDoc is back in place.

panphora added a commit that referenced this pull request Nov 14, 2026
…olbar labels, and right-to-left writing

- autoResize minHeight and maxHeight accept px, rem, em, vh, vw, vmin and vmax
- Toolbar icons are hidden from screen readers
- Pasting one safe URL over selected text writes [text](url); linkPaste: false turns it off
- Headings go to six levels, with optional strikethrough and H4-H6 toolbar buttons
- A labels option translates the toolbar, with OverType.defaultLabels as the English source
- A dir option ('ltr', 'rtl', 'auto') writes right to left with the overlay aligned

Written from the ideas in PRs #117, #118, #119, #127, #128 and #129.
@panphora

Copy link
Copy Markdown
Owner

Thanks for this, and for checking Hebrew and Arabic! 2.9.0 has a dir option ('ltr', 'rtl' or 'auto'), so I'm closing this one.

@panphora panphora closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants