quran / quran-ios

QuranEngine is the engine powering the Quran.com iOS app.
Apache License 2.0
460 stars 159 forks source link

Fix Arabic Text Rendering in Notes Sharing #650

Closed yismailuofa closed 2 months ago

yismailuofa commented 2 months ago

Tries to fix the issue with brackets in texts with bidirectional languages by nesting the arabic text with unicode characters

Based off of these Apple Docs and this Stack Overflow

https://github.com/user-attachments/assets/45397e0b-3844-495f-8933-ae590ffb4a88

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 39.68%. Comparing base (d9fc366) to head (82e6d21). Report is 12 commits behind head on main.

Files Patch % Lines
Features/NotesFeature/NotesViewModel.swift 0.00% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #650 +/- ## ========================================== - Coverage 40.92% 39.68% -1.25% ========================================== Files 525 526 +1 Lines 20880 19439 -1441 ========================================== - Hits 8546 7715 -831 + Misses 12334 11724 -610 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mohamede1945 commented 2 months ago

Oh, this is amazing find. I didn't know about this.

I think this is best suited to be implemented in:

https://github.com/quran/quran-ios/blob/592e0e895c53ae3bb357b1e8946e3a34edffca80/Domain/QuranTextKit/Sources/ShareableText/ShareableVerseTextRetriever.swift#L68

This way it will be useful for any sharing functionality not just the notes sharing including sharing or copying quran text from the main quran page.

PS:

yismailuofa commented 2 months ago

I think this is best suited to be implemented in ...

Refactored it out and updated the tests to match (and formatted it this time 😅 )

mohamede1945 commented 2 months ago

Jazak Allah khyrn! Looks amazing! I'll merge the PR as soon as the CI finishes.