From dc748bcc1a66beb28b19c01128fe9d9154740a9e Mon Sep 17 00:00:00 2001 From: OmrSi Date: Sat, 14 Nov 2020 22:04:17 +0200 Subject: [PATCH] Fix for Arabic comma when reversed --- src/Controls/SETextBox.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Controls/SETextBox.cs b/src/Controls/SETextBox.cs index 8352f2a91..efecab6e9 100644 --- a/src/Controls/SETextBox.cs +++ b/src/Controls/SETextBox.cs @@ -145,9 +145,18 @@ namespace Nikse.SubtitleEdit.Controls _fixedArabicComma = false; var s = value; - if (!Configuration.Settings.General.RightToLeftMode && s.EndsWith('،') && !s.Contains('\u202A')) + if (!Configuration.Settings.General.RightToLeftMode && !s.Contains('\u202A')) { - s = s.Replace("،", "\u202A،"); + string textNoTags = HtmlUtil.RemoveHtmlTags(s, true); + if (textNoTags.EndsWith('،')) + { + s = s.Replace("،", "\u202A،"); + } + else if (textNoTags.StartsWith('،')) + { + s = s.Replace("،", "،\u202A"); + } + _fixedArabicComma = true; }