Markdown report does not escape bare URLs, so GitHub renders them as links

Open Beginner friendly
#199 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, go

Research direction

Start with internal/report/markdown.go:145-157 and its contract comment, then inspect the report tests and golden files for mdInline. Add coverage for https://, http:// and www. inputs and update any affected goldens. Done when those inputs no longer render as autolinks and the tests pass.

Written by the indexing model from the issue text.

Description

bug good first issue severity: low

Summary

The markdown renderer escapes markdown punctuation but leaves www., http:// and https:// intact, and GitHub-flavored Markdown turns those into links. The renderer's own contract is that text from the target is never written raw.

Where

  • internal/report/markdown.go:8 (contract comment)
  • internal/report/markdown.go:145-157 (mdInline)
  • internal/report/doc.go:229, internal/engine/run.go:535 (notes with target paths)
  • action.yml:264 (report appended to the job summary)

Details

The escaped set covers \, backtick, *, _, brackets, angle brackets, |, #, ~, !, &, $ and @. None of ., : or / is escaped, so GFM extended autolinks still match. No test in internal/report mentions autolinks. Checked against the GFM specification, not in a browser.

Impact

A file name, finding title or note taken from scanned content can appear as a clickable link in the markdown report and in the job summary. No markup or script is involved; the effect is limited to links.

Steps to reproduce

  1. Commit a file larger than 1 MiB named www.example.org and run spackle scan . --format markdown.
  2. The report contains a "Not read: www.example.org" note, which GitHub renders with the name as a link.

Suggested fix

In mdInline, break the autolink triggers: write www\. for a www. at a word start and \: for the colon of :// (a backslash before ASCII punctuation is dropped by the renderer and stops the autolink match).

Acceptance criteria

  • A test with https://, http:// and www. inputs asserts the output does not autolink
  • Golden files are updated and the diff is explained

Related: #45, #129

Getting started

  • Relevant files: action.yml, internal/report/doc.go, internal/report/markdown.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/report/markdown.go|mdInline

Dominant language
Go
Stars
0
Forks
1
Avg merge
8h 14m
Merged PRs (30d)
3

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TMHSDigital/Spackle

All issues in TMHSDigital/Spackle

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.