Extends the fix for #11888 (c8c68ec0a) to footnote definitions in
the Markdown reader and to grid table cells. Otherwise, when one of
these ends a file, relative paths in it can be rebased against the
next file on the command line.
Closes #12001.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>