李昊 %!s(int64=4) %!d(string=hai) anos
pai
achega
da2336d87c

+ 16 - 0
gx_api/GxPress/Service/GxPress.Service.Implement/Epub/EpubService.cs

@@ -90,6 +90,7 @@ namespace GxPress.Service.Implement.Epub
             foreach (EpubNavigationItem chapter in epubBook.Navigation)
             {
 
+
                 if (chapter.HtmlContentFile.FileName.Equals(request.CatalogId) || chapter.Title.Equals(request.CatalogNameg))
                 {
                     if (i > sectionValue && sectionValue > 0)
@@ -101,6 +102,21 @@ namespace GxPress.Service.Implement.Epub
                     htmlContent = HtmlAgilityPackHelper.GetHmtl(chapter.HtmlContentFile.Content);
                     break;
                 }
+                foreach (var item in chapter.NestedItems)
+                {
+                    if (item.HtmlContentFile.FileName.Equals(request.CatalogId) || item.Title.Equals(request.CatalogNameg))
+                    {
+                        if (i > sectionValue && sectionValue > 0)
+                        {
+                            htmlContent = HtmlAgilityPackHelper.GetHmtlContent(item.HtmlContentFile.Content);
+                            break;
+                        }
+                        //当前文本内容文件的HTML
+                        htmlContent = HtmlAgilityPackHelper.GetHmtl(item.HtmlContentFile.Content);
+                        break;
+                    }
+                    i++;
+                }
                 i++;
             }
             return htmlContent;