mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Fix for auto br line / French - thx Norbert :)
This commit is contained in:
parent
14ccc6960e
commit
6026ab6989
@ -64,6 +64,15 @@ namespace Test.Logic
|
||||
Assert.AreEqual(s1, s2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AutoBreakFrenchSpaceBeforePunctuation()
|
||||
{
|
||||
Configuration.Settings.General.SubtitleLineMaximumLength = 43;
|
||||
string s1 = "Et elle te le dis maintenant ? Pour quoi donc ?";
|
||||
string s2 = Utilities.AutoBreakLine(s1, "fr");
|
||||
Assert.AreEqual("Et elle te le dis maintenant ?" + Environment.NewLine + "Pour quoi donc ?", s2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AutoBreakLine5DoNoBreakAtTwoMusicTaggedLines()
|
||||
{
|
||||
@ -443,7 +452,7 @@ namespace Test.Logic
|
||||
{
|
||||
var s1 = "<i<Hallo!<i/>";
|
||||
string s2 = HtmlUtil.FixInvalidItalicTags(s1);
|
||||
Assert.AreEqual( "<i>Hallo!</i>", s2);
|
||||
Assert.AreEqual("<i>Hallo!</i>", s2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@ -717,7 +726,7 @@ namespace Test.Logic
|
||||
public void RemoveLineBreaks5()
|
||||
{
|
||||
string result = Utilities.RemoveLineBreaks("<i>Foobar" + Environment.NewLine + "</i>");
|
||||
Assert.AreEqual( "<i>Foobar</i>", result);
|
||||
Assert.AreEqual("<i>Foobar</i>", result);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
@ -248,6 +248,15 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nextChar == ' ' && language == "fr" && index + 1 < s.Length)
|
||||
{
|
||||
var nextNext = s[index + 1];
|
||||
if (nextNext == '?' || nextNext == '!' || nextNext == '.')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user