fn rehome_text_companion(
note: &str,
workdir: &Result<Workdir>,
container_root: &str,
) -> StringExpand description
Rewrites a text version: <path> segment of a document’s note to the container-side path
rehome_one copied it to, keeping the rest of the note (page count, “contains macros”) as is.
Drops just that segment, rather than leaving a host path, when the companion carries no
recognizable id or its copy fails. Matches only a segment that STARTS WITH the marker, never a
bare substring: file_note’s failure note reads “no text version: {e}”, which contains “text
version: “ too but names no path to rehome — matching that would delete the error text instead
(#2586). A note with neither segment shape (an image’s note is always None) is unchanged.