ancestry grows to len(meta.Parents)+1. The subsequent warning log
indexed meta.Parents[len(ancestry)-1], which is one past the end of
meta.Parents, causing an out-of-bounds panic. Use ancestry[len(ancestry)-1]
to always reference the last element of the actual slice being validated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous pattern [^\!]\[...\] required exactly one non-! character
before the opening bracket, so a markdown link at the very start of
anchors to start-of-string or a non-! character without consuming
a required preceding character.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
http.DetectContentType was called with potentially nil/empty contents
when ReadFile failed; the error was only checked afterward. Move the
error check immediately after ReadFile so bad data is never used.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previously, relative markdown links only resolved to Confluence pages.
Now the lookup also searches for blog posts if a page is not found,
enabling links like [My Blog](./blog-post.md) to work correctly.