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

未關閉 適合新手
#199 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
82/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, go

研究方向

從 internal/report/markdown.go:145-157 及其契約註解開始,接著檢查 mdInline 的報告測試和 golden 檔案。為 https://、http:// 和 www. 輸入新增測試涵蓋,並更新所有受影響的 golden 檔案。這些輸入不再呈現為自動連結且測試通過後,即算完成。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Go
星號
0
分支
1
平均合併
8 小時 14 分鐘
30 天內合併 PR
3

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Spackle 的其他 Issue

查看 TMHSDigital/Spackle 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。