summaryrefslogtreecommitdiff
path: root/internal/processor/markdown.go
AgeCommit message (Collapse)Author
2026-04-27processor: introduce PostBuilder registry to replace hardcoded switchPaul Buetow
Replace the large, duplicate switch statements in planPost and commitPlan with a PostBuilder interface registered per file extension. - PostBuilder interface: Plan(srcPath, ext) (postPlan, error) and Commit(plan, postDir, id, now) (*post.Post, []string, error) - Per-type builders: txtBuilder, mdBuilder, imageBuilder, audioBuilder. - Each builder self-registers via init() into a map[string]PostBuilder. - Core processor loops are now extension-agnostic, satisfying OCP/DIP. - All existing tests pass.
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: document trusted inbox trust boundary for markdown HTMLPaul Buetow
Markdown uses goldmark html.WithUnsafe for intentional raw HTML in personal-inbox posts. Package and processMd comments state the trust model and warn against untrusted input on the same path. Made-with: Cursor
2026-04-09add snonux static microblog generatorPaul Buetow
Full Go implementation with: - txt/md/image/audio input processing, URL auto-linking in .txt files - Paginated HTML output with Atom feed - 11 visual themes: neon, terminal, synthwave, minimal, brutalist, paper, aurora, matrix, ocean, retro, glass (selectable via --theme flag) - Keyboard navigation (j/k/arrows, Enter modal, h/l page nav) - Shared nav templates (navhints, navmodal, navscript) across all themes - Magefile build automation; integration test suite covering all themes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>