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

Smart Punctuation is incorrect on RTL direction #926

Open
aleemb opened this issue Sep 23, 2022 · 1 comment
Open

Smart Punctuation is incorrect on RTL direction #926

aleemb opened this issue Sep 23, 2022 · 1 comment
Labels
up-for-grabs Please feel free to take this one!

Comments

@aleemb
Copy link
Contributor

aleemb commented Sep 23, 2022

Version(s) affected

2.3

Description

In RTL languages the smart punctuation should be reversed so 'رہیں' generates ’رہیں‘ instead of the desired ‘رہیں’.

It's possible to change up the config to reverse the open/close but language detection (especially for bilingual setups) would be very useful.

@aleemb aleemb changed the title Smart Punctuation is incorrect on RTL Smart Punctuation is incorrect on RTL direction Sep 23, 2022
@colinodell
Copy link
Member

Thanks for raising this issue!

Unfortunately, proper RTL support hasn't been introduced into the CommonMark spec yet :-/ For example, there's a known issue where using the RTL mark can break emphasis. There are also several unresolved discussions about RTL support like this one.

I unfortunately don't know much about the intricacies of text direction in Unicode, but I suspect that the ideal solution would probably involve detecting the direction within the Unicode character stream (and perhaps being able to set a default direction for documents), and using that to determine how smart punctuation should work. This would probably be more accurate (and perhaps more efficient too) than trying to detect languages.

@colinodell colinodell added the up-for-grabs Please feel free to take this one! label Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up-for-grabs Please feel free to take this one!
Projects
None yet
Development

No branches or pull requests

2 participants