mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
parent
daf2843ded
commit
df955a1e62
@ -625,8 +625,11 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
int italicBeginTagCount = Utilities.CountTagInText(text, beginTag);
|
||||
int italicEndTagCount = Utilities.CountTagInText(text, endTag);
|
||||
int noOfLines = Utilities.GetNumberOfLines(text);
|
||||
if (italicBeginTagCount + italicEndTagCount > 0)
|
||||
if (italicBeginTagCount + italicEndTagCount == 0)
|
||||
{
|
||||
return preTags + text;
|
||||
}
|
||||
|
||||
if (italicBeginTagCount == 1 && italicEndTagCount == 1 && text.IndexOf(beginTag, StringComparison.Ordinal) > text.IndexOf(endTag, StringComparison.Ordinal))
|
||||
{
|
||||
const string pattern = "___________@";
|
||||
@ -763,7 +766,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
text = beginTag + text + endTag;
|
||||
}
|
||||
|
||||
if (italicBeginTagCount == 0 && italicEndTagCount == 2 && text.StartsWith(endTag, StringComparison.Ordinal) && text.EndsWith(endTag, StringComparison.Ordinal))
|
||||
if (italicBeginTagCount == 0 && italicEndTagCount == 2)
|
||||
{
|
||||
int firstIndex = text.IndexOf(endTag, StringComparison.Ordinal);
|
||||
text = text.Remove(firstIndex, endTag.Length).Insert(firstIndex, beginTag);
|
||||
@ -876,7 +879,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
text = text.Replace("<i></i>", string.Empty);
|
||||
text = text.Replace("<i> </i>", string.Empty);
|
||||
text = text.Replace("<i> </i>", string.Empty);
|
||||
}
|
||||
|
||||
return preTags + text;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user