summaryrefslogtreecommitdiff
path: root/internal/processor/markdown_test.go
AgeCommit message (Collapse)Author
2026-04-27Add context.Context to I/O-bound public APIs (generator.Run, processor.Run, ↵Paul Buetow
atom.Generate, syncOutput) - generator.Run(ctx, cfg) – ctx passed through to atom.Generate - processor.Run(ctx, cfg) – signature updated for cancellation propagation - atom.Generate(ctx, posts, cfg) – accepts ctx for future cancellation - syncOutput(ctx, cfg) – rsync subprocesses now use exec.CommandContext - Updated all call sites in tests, cmd/snonux/main.go, and integration tests - All call sites pass context.Background() / context.TODO() All tests pass: go test ./...
2026-04-27processor: reject markdown image refs with path separators or parent traversalPaul Buetow
findLocalImages used filepath.Base(ref) after stat succeeded, which caused subdirectory or parent-directory references to pass the scan but then fail during copy because the basename was looked up in the wrong directory. Fix: add isSimpleImageRef helper that accepts only flat filenames (no path separators, no .. traversal). findLocalImages now returns the ref unchanged, matching what copyLocalImages and claimedByMarkdown expect. Added tests for isSimpleImageRef and negative findLocalImages cases for subdirectory and parent-directory references.
2026-04-10processor: return error when markdown pre-scan cannot read .mdPaul Buetow
claimedByMarkdown now wraps os.ReadFile failures instead of skipping, so Run fails fast and avoids wrong image claim state. Add regression test using an unreadable markdown file (Unix). Made-with: Cursor
2026-04-10test: add table-driven unit tests for post, processor, generatorPaul Buetow
Cover NewID; txt autolink helpers; markdown local image discovery; pagination, page filenames, JSON script literals, time formatting, and buildPageData nav links. Made-with: Cursor