mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
Lower all tags, possible bugs fix
This commit is contained in:
parent
6fd8c45f3a
commit
fe884a4a58
@ -741,6 +741,18 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
|
||||
internal static string RemoveLineBreaks(string s)
|
||||
{
|
||||
var tags = new string[] { "<I>", "<U>", "<B>", "<FONT" };
|
||||
var idx = s.IndexOfAny(tags, StringComparison.Ordinal);
|
||||
while (idx >= 0)
|
||||
{
|
||||
var endIdx = s.IndexOf('>', idx + 3);
|
||||
if (endIdx < idx)
|
||||
break;
|
||||
var tag = s.Substring(idx, endIdx - idx).ToLowerInvariant();
|
||||
s = s.Remove(idx, endIdx - idx).Insert(idx, tag);
|
||||
idx = s.IndexOfAny(tags, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
s = s.Replace(Environment.NewLine + "</i>", "</i>" + Environment.NewLine);
|
||||
s = s.Replace(Environment.NewLine + "</b>", "</b>" + Environment.NewLine);
|
||||
s = s.Replace(Environment.NewLine + "</u>", "</u>" + Environment.NewLine);
|
||||
|
Loading…
Reference in New Issue
Block a user