Skip to content

feat: Add RTL (Right-to-Left) support for markmap#336

Open
vahidsharifi wants to merge 1 commit into
markmap:masterfrom
vahidsharifi:feat/rtl-support-95
Open

feat: Add RTL (Right-to-Left) support for markmap#336
vahidsharifi wants to merge 1 commit into
markmap:masterfrom
vahidsharifi:feat/rtl-support-95

Conversation

@vahidsharifi

Copy link
Copy Markdown

Resolves #95

📝 Summary

This PR implements comprehensive RTL support for markmap, enabling proper rendering of RTL languages like Arabic, Hebrew, and Persian, as requested in issue #95.

Key Features

  • RTL Layout Engine: Complete coordinate transformation for right-to-left flow
  • Line Continuity Fix: Resolved broken connecting lines in RTL mode
  • Configuration Option: Added rtl: true/false in markmap options and frontmatter
  • CSS Styling: Proper text direction and alignment for RTL content
  • Type Safety: Full TypeScript interfaces and type definitions
  • Backward Compatibility: RTL defaults to false, no breaking changes

🧪 Testing

  • 30 tests passing (including 11 new RTL-specific tests)
  • Real-world content: Tested with Arabic and Persian examples
  • Interactive features: Zoom, pan, expand/collapse all working
  • Code quality: ESLint and Prettier compliant

📋 Usage Example

---
markmap:
  rtl: true
---
# Arabic Example / مثال عربي
## Features / الميزات  
- RTL Layout / تخطيط من اليمين إلى اليسار
- Continuous Lines / خطوط متواصلة

Resolves markmap#95

- Add rtl option to markmap configuration
- Implement RTL layout with coordinate transformation
- Add RTL CSS styling and text direction
- Fix horizontal line continuity in RTL mode
- Add comprehensive test suite (11 RTL tests)
- Support RTL frontmatter parsing
- All 30 tests passing
@ducmaiitl

Copy link
Copy Markdown

How can I run this package on the local? Trying to do some customizations. Tks.

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.

Handle RTL correctly

2 participants