Globalization Extension is biased against English characters #524

Closed
opened 2026-01-29 14:38:45 +00:00 by claunia · 2 comments
Owner

Originally created by @mhmd-azeez on GitHub (Apr 13, 2022).

Due to an optimization check, the extension ignores English characters entirely. So for this text:

aaa سڵاو

expected: LTR
actual: RTL

And this case:

سڵاو aaa

expected: RTL
actual: RTL

(This case above is correct, I just wrote it to make sure we don't mess it up when tying to fix the first one).

The fix is just to remove this check.

Originally created by @mhmd-azeez on GitHub (Apr 13, 2022). Due to an optimization check, the extension ignores English characters entirely. So for this text: ``` aaa سڵاو ``` expected: LTR actual: RTL And this case: ``` سڵاو aaa ``` expected: RTL actual: RTL (This case above is correct, I just wrote it to make sure we don't mess it up when tying to fix the first one). The fix is just to remove [this check](https://github.com/xoofx/markdig/blob/cb26f30f7bff7dd91bc69902a80cf97f0d445b69/src/Markdig/Extensions/Globalization/GlobalizationExtension.cs#L96).
claunia added the bugPR Welcome! labels 2026-01-29 14:38:45 +00:00
Author
Owner

@MihaZupan commented on GitHub (Apr 13, 2022):

You're right, nice catch. Looks like I broke this in c964659085.

@MihaZupan commented on GitHub (Apr 13, 2022): You're right, nice catch. Looks like I broke this in c964659085ec53ce27e7044e105303e0fba8ee36.
Author
Owner

@mhmd-azeez commented on GitHub (Apr 13, 2022):

@MihaZupan no worries, it happens. I am surprised none of the tests broke though

@mhmd-azeez commented on GitHub (Apr 13, 2022): @MihaZupan no worries, it happens. I am surprised none of the tests broke though
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#524