Two problems found scanning a document and taking a photo on a phone.
- With the caret on a heading's line, the file was attached to that heading but
ImageYank.insertingput the link on a new line above it, in the previous entry (or before the first heading). Following the link then reported "No file …", because that entry's attachment folder doesn't hold the file. The link now goes under the heading, after its planning line, drawers and clock lines (OrgAttach.belowHeading). This affects Take Photo…, Scan Document…, pasted images and dropped files. HTMLExport.pagewroteattachment:links unchanged (<img src="attachment:photo.jpg">).ExportPreprocess.attachmentsnow turns them intofile:links into the entry's attachment folder before parsing, asorg-attach-expand-linksdoes, falling back to the Org file's folder as Emacs 31 does. PDF export and Export to HTML and Open use the same page.OrgSettingscarriesorg-attach-id-dirandorg-attach-use-inheritancefor the exporter.
Markdown, LaTeX, ODT and ASCII export are unchanged.