feat: read hyperlinks of InDesign 5.0 files

InDesign 5.0 destinations have no key, hyperlinks name their destination
by UID, text destination owners use chunk 0x1351E, and text sources are
placed by start and end markers owned by the story (chunk 0x13524)
instead of a range tree. These are read by version; keys are left out
where there are none.

No 5.0 file has an IDML. Over the 17 5.0 files with hyperlinks: 121
hyperlinks, 118 text sources, 7 text destinations and 45 bookmarks are
now written, the 116 warnings about their destination objects are gone,
and every output validates. Pair results unchanged (91.92 %, extra
values 26,516). Schema validation: 0 failures.
This commit is contained in:
aiongg committed 2026-10-08 02:22:33 +00:00
1 parent 18449cc430
commit 64e5667dfd
8 files changed
+150 -21

No files matched your search

+2 -1
View File
@@ -133,6 +133,7 @@ impl<'a> Reader<'a> {
/// An object that cannot be read is left out with a warning; the
/// warnings are in `Document::warnings`.
pub fn document(&self, version: Version) -> Result<Document, Error> {
self.major.set(version.major);
// The first layer of the list is the internal layer, whatever its
// name (objects.md, layers).
let layers = self
@@ -396,7 +397,7 @@ impl<'a> Reader<'a> {
}
}
hyperlink::class::HYPERLINK => {
if let Some(h) = Hyperlink::read(uid, &*self.object(uid)?)? {
if let Some(h) = Hyperlink::read(uid, &*self.object(uid)?, self.major.get())? {
out.hyperlinks.push(h);
}
}