Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): add tiptap-text-direction extension to support RTL #6874

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JuliaKirschenheuter
Copy link
Contributor

📝 Summary

Now it is possible to detect RTL writing style for languages, which requires RTL. Using https://github.com/amirhhashemi/tiptap-text-direction extension. This version works for:

  • Paragraph
  • Heading
  • Lists

🖼️ Screenshots

🏚️ Before 🏡 After
Screenshot from 2025-01-23 16-09-02 Screenshot from 2025-01-23 16-07-29

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Copy link

@hamza221 hamza221 left a comment

Choose a reason for hiding this comment

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

Looks good 🙏🏼

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

The test failures look related as now dir="ltr" is include in some of the html output of the unit tests. I think you can just adjust the expectation to match the actual outcome - and we get a test for this extension for free.

Other than that and the linter fix this looks great. Thanks for looking into it!

Would be nice if we could backport it as I think it really fixes a UX bug for rtl and mixed language use.

@@ -43,6 +43,7 @@ import TaskList from './../nodes/TaskList.js'
import Text from '@tiptap/extension-text'
import TrailingNode from './../nodes/TrailingNode.js'
/* eslint-enable import/no-named-as-default */
import TextDirection from 'tiptap-text-direction'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah... this also triggers the import/no-named-as-default eslint rule. So please move it one line up so it's in the eslint-disable block above.

Thanks!

@max-nextcloud max-nextcloud self-assigned this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

RTL support
3 participants