Check if paragraph is allowed to fix before stripping HTML tags

This commit is contained in:
Ivandro Ismael 2015-08-07 08:24:06 +01:00
parent 18df8da37d
commit 6e365e1ae6

View File

@ -1177,17 +1177,19 @@ namespace Nikse.SubtitleEdit.Forms
for (int i = 0; i < Subtitle.Paragraphs.Count; i++)
{
Paragraph p = Subtitle.Paragraphs[i];
string s = HtmlUtil.RemoveHtmlTags(p.Text);
if (s.Replace(Environment.NewLine, " ").Replace(" ", " ").Length < Configuration.Settings.Tools.MergeLinesShorterThan && p.Text.Contains(Environment.NewLine))
if (AllowFix(p, fixAction))
{
s = Utilities.AutoBreakLine(p.Text, Language);
if (AllowFix(p, fixAction) && s != p.Text)
string s = HtmlUtil.RemoveHtmlTags(p.Text, true);
if (s.Replace(Environment.NewLine, " ").Replace(" ", " ").Length < Configuration.Settings.Tools.MergeLinesShorterThan && p.Text.Contains(Environment.NewLine))
{
string oldCurrent = p.Text;
p.Text = s;
noOfShortLines++;
AddFixToListView(p, fixAction, oldCurrent, p.Text);
s = Utilities.AutoBreakLine(p.Text, Language);
if (s != p.Text)
{
string oldCurrent = p.Text;
p.Text = s;
noOfShortLines++;
AddFixToListView(p, fixAction, oldCurrent, p.Text);
}
}
}
}