mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Extra fix for badly formattes files
This commit is contained in:
parent
63f220d982
commit
d51c7fc2b6
@ -52,7 +52,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
try
|
||||
{
|
||||
xml.LoadXml(xmlAsString.Replace(" & ", " and "));
|
||||
xml.LoadXml(xmlAsString.Replace(" & ", " & "));
|
||||
var nsmgr = new XmlNamespaceManager(xml.NameTable);
|
||||
nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
|
||||
var nds = xml.DocumentElement.SelectSingleNode("ttml:body", nsmgr);
|
||||
@ -393,7 +393,15 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
var sb = new StringBuilder();
|
||||
lines.ForEach(line => sb.AppendLine(line));
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(sb.ToString().Trim());
|
||||
|
||||
try
|
||||
{
|
||||
xml.LoadXml(sb.ToString().Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
xml.LoadXml(sb.ToString().Replace(" & ", " & ").Trim());
|
||||
}
|
||||
|
||||
string ns = "http://www.w3.org/ns/ttml";
|
||||
var nsmgr = new XmlNamespaceManager(xml.NameTable);
|
||||
|
Loading…
Reference in New Issue
Block a user