Allow blank lines in DCinema - thx Axel :)

This commit is contained in:
Nikolaj Olsson 2021-02-10 08:10:00 +01:00
parent 6b7ca010f0
commit f51dae66b4
4 changed files with 17 additions and 0 deletions

View File

@ -444,6 +444,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
}
}
textNode.InnerXml = html.ToString();
if (html.Length == 0)
{
textNode.InnerText = " "; // We need to have at least a single space character on exporting empty subtitles, because otherwise I will get errors on import.ou need to have at least a single space character on exporting empty subtitles, otherwise we will get errors on import.
}
subNode.AppendChild(textNode);
if (alignVTop)

View File

@ -432,6 +432,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
}
}
textNode.InnerXml = html.ToString();
if (html.Length == 0)
{
textNode.InnerText = " "; // We need to have at least a single space character on exporting empty subtitles, because otherwise I will get errors on import.ou need to have at least a single space character on exporting empty subtitles, otherwise we will get errors on import.
}
subNode.AppendChild(textNode);
if (alignVTop)

View File

@ -433,6 +433,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
}
}
textNode.InnerXml = html.ToString();
if (html.Length == 0)
{
textNode.InnerText = " "; // We need to have at least a single space character on exporting empty subtitles, because otherwise I will get errors on import.ou need to have at least a single space character on exporting empty subtitles, otherwise we will get errors on import.
}
subNode.AppendChild(textNode);
if (alignVTop)

View File

@ -433,6 +433,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
}
}
textNode.InnerXml = html.ToString();
if (html.Length == 0)
{
textNode.InnerText = " "; // We need to have at least a single space character on exporting empty subtitles, because otherwise I will get errors on import.ou need to have at least a single space character on exporting empty subtitles, otherwise we will get errors on import.
}
subNode.AppendChild(textNode);
if (alignVTop)
@ -444,6 +448,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
vPos -= vPosFactor;
}
}
if (subNode.InnerXml.Length == 0)
{ // Empty text is just one space
XmlNode textNode = xml.CreateElement("dcst:Text", "dcst");