mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Fix bad xml replace in "TTML 1.0"- thx Info :)
This commit is contained in:
parent
1606f7d8d7
commit
1c328acdc8
@ -528,8 +528,21 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
text = string.Join("<br/>", text.SplitToLines());
|
text = string.Join("<br/>", text.SplitToLines());
|
||||||
XmlDocument paragraphContent = new XmlDocument();
|
var paragraphContent = new XmlDocument();
|
||||||
paragraphContent.LoadXml($"<root>{text.Replace("&", "&")}</root>");
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
paragraphContent.LoadXml($"<root>{text.Replace("&", "&")}</root>");
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
var guid = Guid.NewGuid().ToString();
|
||||||
|
var tempText = text.Replace("&", guid);
|
||||||
|
tempText = tempText.Replace("&", "&");
|
||||||
|
tempText = tempText.Replace(guid, "&");
|
||||||
|
paragraphContent.LoadXml($"<root>{tempText}</root>");
|
||||||
|
}
|
||||||
|
|
||||||
ConvertParagraphNodeToTtmlNode(paragraphContent.DocumentElement, xml, paragraph);
|
ConvertParagraphNodeToTtmlNode(paragraphContent.DocumentElement, xml, paragraph);
|
||||||
}
|
}
|
||||||
catch // Wrong markup, clear it
|
catch // Wrong markup, clear it
|
||||||
|
Loading…
Reference in New Issue
Block a user