From 8f3152bda400b19e1f3b1c472655bd48f65d07d3 Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 15 Nov 2022 23:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=85=E6=9C=89div?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs index 6341824..c2da58b 100644 --- a/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs +++ b/src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs @@ -238,7 +238,18 @@ namespace Mp4SubtitleParser { foreach (Match img in ImageRegex().Matches(xmlDoc.InnerXml)) { - imageDic.Add(img.Groups[1].Value, img.Groups[2].Value); + imageDic.Add(img.Groups[1].Value.Trim(), img.Groups[2].Value.Trim()); + } + } + + //convert
to

+ if (_div!.SelectNodes("ns:p", nsMgr) == null || _div!.SelectNodes("ns:p", nsMgr)!.Count == 0) + { + foreach (XmlElement _tDiv in bodyNode.SelectNodes("ns:div", nsMgr)!) + { + var _p = xmlDoc.CreateDocumentFragment(); + _p.InnerXml = _tDiv.OuterXml.Replace("

", "

"); + _div.AppendChild(_p); } }