diff --git a/libse/SubtitleFormats/Spt.cs b/libse/SubtitleFormats/Spt.cs
index 42c12a232..eafe8dfd1 100644
--- a/libse/SubtitleFormats/Spt.cs
+++ b/libse/SubtitleFormats/Spt.cs
@@ -134,6 +134,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
int textLengthFirstLine = buffer[index + 16 + 20];
int textLengthSecondLine = buffer[index + 16 + 20 + 4];
+ var allItalic = buffer[index + 16 + 4] == 1;
if (textLengthFirstLine == 0 && textLengthSecondLine == 0)
{
@@ -156,6 +157,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
p.Text += Environment.NewLine + Encoding.Default.GetString(buffer, index + 16 + 20 + 16 + textLengthFirstLine, textLengthSecondLine);
}
+ if (allItalic)
+ {
+ p.Text = "" + p.Text.Trim() + "";
+ }
+
index += 16 + 20 + 16 + textLengthFirstLine + textLengthSecondLine;
return p;
}
diff --git a/libse/SubtitleFormats/Sptx.cs b/libse/SubtitleFormats/Sptx.cs
index 7112fc320..343f9d672 100644
--- a/libse/SubtitleFormats/Sptx.cs
+++ b/libse/SubtitleFormats/Sptx.cs
@@ -78,6 +78,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
if (ok)
{
+ var allItalic = buffer[index + 16 + 4] == 1;
var length1 = buffer[index + 16 + 20];
var length2 = buffer[index + 16 + 26];
var length = length1;
@@ -99,6 +100,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
EndTime = GetTimeCode(Encoding.UTF8.GetString(buffer, index + 8, 8)),
Text = FixItalics(text)
};
+ if (allItalic)
+ {
+ p.Text = "" + p.Text.Trim() + "";
+ }
+
index += 16;
return p;
}