From 8ab19ac7f34c2fc6ab911f80939efe5703cb2bbd Mon Sep 17 00:00:00 2001 From: Michael Fenwick Date: Thu, 21 Nov 2024 13:46:16 -0800 Subject: [PATCH] Fixed manifest writer to include properties attribute. After writing an epub, the manifest would end up with a `#nav` item which lacked a `properties` attribute. That is, the manifest item `` would be written as `` This is problematic as the manifest reader uses that attribute to identify the nav item, preventing a written book from being read again (an exception would be thrown if reading was attempted). This change ensures that the `properties` attribute is written to each manifest element if it has a value, resolving this problem. --- lib/src/writers/epub_manifest_writer.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/writers/epub_manifest_writer.dart b/lib/src/writers/epub_manifest_writer.dart index deee2dee..56d2fbc5 100644 --- a/lib/src/writers/epub_manifest_writer.dart +++ b/lib/src/writers/epub_manifest_writer.dart @@ -10,6 +10,9 @@ class EpubManifestWriter { ..attribute('id', item.Id!) ..attribute('href', item.Href!) ..attribute('media-type', item.MediaType!); + if (item.Properties != null) { + builder.attribute('properties', item.Properties); + } }); }); });