Add a dir option for right-to-left languages

Closed
RO
12d ago
+546-124

'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.