18 Commits

Author SHA1 Message Date
Manuel Rüger
5b87945f23 fix: use ancestry slice for warning log, not meta.Parents
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>
2026-03-16 19:18:29 +01:00
Manuel Rüger
2a505a24a8 fix: parseLinks regex misses links at position 0 of string
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>
2026-03-16 19:18:29 +01:00
Manuel Rüger
9e7f2cf9d5 fix: check os.ReadFile error before using file contents
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>
2026-03-16 19:18:29 +01:00
Johan Fagerberg
9516939c7d feat: add support for --content-appearance 2026-03-11 12:47:35 +01:00
Nikolai Emil Damm
16f72b00bd feat: extend link resolution to support blog posts
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.
2026-01-06 15:25:59 +01:00
Nikolai Emil Damm
a334c1c1cc feat: enhance Confluence link generation by utilizing base URL from API response
Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
2026-01-06 15:25:59 +01:00
Nikolai Emil Damm
2784c925a2 fix: update test cases for large page IDs to reflect Confluence Cloud examples
Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
6d5a9fba90 feat: implement GenerateTinyLink function and associated tests for Confluence tiny link generation
Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
ef560d095c fix: resolve link space inheritance and enhance Confluence URL normalization tests
Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
0dd5ea9aee Clean up comments in normalizeConfluenceWebUIPath
Removed comments from normalizeConfluenceWebUIPath function.
2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
b2efff89e1 Update example path in link.go comments 2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
0a821fb1c5 Update link_test.go 2026-01-05 15:33:43 +01:00
Nikolai Emil Damm
b4370c09c6 feat: add normalizeConfluenceWebUIPath function and tests for URL rewriting
Signed-off-by: Nikolai Emil Damm <ndam@tv2.dk>
2026-01-05 15:33:43 +01:00
Manuel Rüger
be4ff0d58a Use mimesniffing to detect text files 2025-12-08 21:36:28 +01:00
Manuel Rüger
d0e302cccc Fix sigsegv 2025-09-15 19:01:21 +02:00
Dennis Verheijden
0f13d249f5 Add support for using the filename as the page title 2025-09-15 11:07:30 +02:00
Peter Landoll
b0f337c4a3 feat: add flag to append hash to pages to ensure unique titles 2024-10-09 00:28:45 +02:00
Manuel Rüger
dc8842106b *: Reorganize code 2024-09-29 00:13:04 +02:00