mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +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
|
||||
{
|
||||
text = string.Join("<br/>", text.SplitToLines());
|
||||
XmlDocument paragraphContent = new XmlDocument();
|
||||
var paragraphContent = new XmlDocument();
|
||||
|
||||
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);
|
||||
}
|
||||
catch // Wrong markup, clear it
|
||||
|
Loading…
Reference in New Issue
Block a user