Skip to content

Clean up main.go and extend test coverage - #78

Merged
mapitman merged 1 commit into
mainfrom
chore/cleanup-and-tests
Oct 14, 2026
Merged

mapitman merged 1 commit into
mainfrom
chore/cleanup-and-tests

Conversation

@mapitman

Copy link
Copy Markdown
Owner
  • Runs gofmt on main.go.
  • Builds the Snap temp path with filepath.Join.
  • Log warnings print without a timestamp and with an mdview: prefix, matching check().
  • Adds tests for getTitleFromAST, isRelativePath and tempFileName.

Already done by earlier PRs: the html parameter shadowing and the per-call regex compile (#74), and tests for traversal limits, the size cap, HTML <img> handling (#74, #75), embedMermaidScript and getTempDir (#77).

Closes #69

Format main.go with gofmt. Build the Snap temp path with filepath.Join. Print log warnings without a timestamp and with the mdview prefix, to match the messages from check(). The html parameter shadowing and the per-call regex compile from the issue were already fixed in the image embedding rewrite.

Add tests for getTitleFromAST, isRelativePath and tempFileName. The traversal limits, size cap, HTML img handling, embedMermaidScript and getTempDir are covered by earlier changes.

Closes #69
@mapitman
mapitman merged commit 6223f95 into main Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code cleanup and test coverage

1 participant