From 022069d5a50586796ea22a94530382a3990ac1b6 Mon Sep 17 00:00:00 2001 From: shmuelbiller1 Date: Fri, 9 Oct 2026 11:33:42 -0400 Subject: [PATCH] fix(links): retain resolved source paths when packaging moved nested documents --- crates/engine/src/cmd/links.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index 575a6f26..59915ff3 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -283,6 +283,9 @@ fn stale(d: &Document, g: &Group) -> bool { pub(crate) struct LinkedFile { pub path: String, pub name: String, + /// The file actually read, which may be next to the current document after a move. + /// Nested links must be resolved against this folder, not the obsolete original path. + pub found_path: Option, /// Read from where the file is found, else the pixels the document holds when they are the /// file's own; `None` when neither. pub bytes: Option>, @@ -297,10 +300,10 @@ pub(crate) fn linked_files(d: &Document, doc_path: Option<&str>) -> Vec