diff --git a/src/Core/FileUtil.cs b/src/Core/FileUtil.cs index 86ba2f24f..daaccb3ab 100644 --- a/src/Core/FileUtil.cs +++ b/src/Core/FileUtil.cs @@ -139,7 +139,7 @@ namespace Nikse.SubtitleEdit.Core if (count != buffer.Length) return false; - return buffer[0] == 0xFF + return buffer[0] == 0xFF && buffer[1] == 0xD8 && buffer[2] == 0xFF; } diff --git a/src/Logic/Forms/RemoveTextForHI.cs b/src/Logic/Forms/RemoveTextForHI.cs index 6258641be..db9078fb2 100644 --- a/src/Logic/Forms/RemoveTextForHI.cs +++ b/src/Logic/Forms/RemoveTextForHI.cs @@ -355,6 +355,7 @@ namespace Nikse.SubtitleEdit.Logic.Forms // Okay! Narrator: Hello! if (pre.IndexOfAny(new[] { '!', '?' }) > 0) return false; + return true; } @@ -889,7 +890,6 @@ namespace Nikse.SubtitleEdit.Logic.Forms text = text.TrimStart('-').TrimStart(); } } - return text; } diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs index 7cd0ce29b..3b6f9b10e 100644 --- a/src/Logic/Utilities.cs +++ b/src/Logic/Utilities.cs @@ -2960,7 +2960,7 @@ namespace Nikse.SubtitleEdit.Logic // Hi bad man! -> Hi bad man! text = text.Replace(" " + openTag + " ", " " + openTag); - text = text.Replace(Environment.NewLine + openTag + " ", Environment.NewLine + openTag); + text = text.Replace(Environment.NewLine + openTag + " ", Environment.NewLine + openTag); // Hi bad man! -> Hi bad man! text = text.Replace(" " + closeTag + " ", closeTag + " "); @@ -3210,4 +3210,4 @@ namespace Nikse.SubtitleEdit.Logic } } -} \ No newline at end of file +} diff --git a/src/Test/Logic/SubtitleFormats/SubtitleFormatsTest.cs b/src/Test/Logic/SubtitleFormats/SubtitleFormatsTest.cs index 8f6a3c0a2..3658cfcb5 100644 --- a/src/Test/Logic/SubtitleFormats/SubtitleFormatsTest.cs +++ b/src/Test/Logic/SubtitleFormats/SubtitleFormatsTest.cs @@ -31,7 +31,7 @@ namespace Test.Logic.SubtitleFormats { _testContextInstance = value; } - } + } #region Additional test attributes @@ -67,7 +67,8 @@ namespace Test.Logic.SubtitleFormats #region SubRip (.srt) - private static List GetSrtLines(string text){ + private static List GetSrtLines(string text) + { var lines = new List(); string[] arr = text.Replace(Environment.NewLine, "\r").Replace("\n", "\r").Split('\r'); foreach (string line in arr)