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

Ouverte Adaptée aux débutants
#199 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
82/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
github-actions, go

Piste de recherche

Commencez par internal/report/markdown.go:145-157 et son commentaire de contrat, puis examinez les tests du rapport et les fichiers golden de mdInline. Ajoutez des tests pour les entrées https://, http:// et www. et mettez à jour tous les fichiers golden concernés. Le travail est terminé lorsque ces entrées ne sont plus rendues sous forme d’autolinks et que les tests passent.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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

Langage dominant
Go
Étoiles
0
Forks
1
Merge moyen
8 h 14 min
PR mergées (30 j)
3

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Spackle

Toutes les issues de TMHSDigital/Spackle

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.