diff --git a/src/Epub/Content.cs b/src/Epub/Content.cs index 5e2ca10..f6d6577 100644 --- a/src/Epub/Content.cs +++ b/src/Epub/Content.cs @@ -1,6 +1,7 @@ using System.IO.Compression; using System.Xml; using System.Xml.Linq; +using Devlooped.Web; namespace Devlooped.Epub; @@ -35,11 +36,8 @@ public XDocument Open() throw new InvalidArchiveException(ThisAssembly.Strings.MissingContent(Href)); using var stream = entry.Open(); - using var reader = XmlReader - .Create(stream, new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore }) - .IgnoreNamespaces(); - return XDocument.Load(reader); + return HtmlDocument.Load(stream); } /// diff --git a/src/Tests/PublicationTests.cs b/src/Tests/PublicationTests.cs index d83d316..7cad20f 100644 --- a/src/Tests/PublicationTests.cs +++ b/src/Tests/PublicationTests.cs @@ -29,6 +29,19 @@ public void CanOpen() Assert.NotNull(pub); } + [Fact] + public void CanReadContentFragments() + { + using var pub = Publication.Open(@"Samples/CCyC_Comentado_Tomo_II.epub"); + + Assert.NotNull(pub.Package.Navigation); + + foreach (var nav in pub.Package.Navigation) + { + var content = nav.Open(); + } + } + [Fact] public void CanAccessPackageInformation() { diff --git a/src/Tests/Samples/CCyC_Comentado_Tomo_II.epub b/src/Tests/Samples/CCyC_Comentado_Tomo_II.epub new file mode 100644 index 0000000..d9d3dba Binary files /dev/null and b/src/Tests/Samples/CCyC_Comentado_Tomo_II.epub differ