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

Abierto Apto para principiantes
#199 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
github-actions, go

Línea de trabajo

Empieza por internal/report/markdown.go:145-157 y su comentario de contrato; después, revisa las pruebas del informe y los archivos golden de mdInline. Añade cobertura para entradas con https://, http:// y www. y actualiza los archivos golden afectados. El trabajo estará terminado cuando esas entradas ya no se rendericen como autolinks y las pruebas pasen.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
0
Forks
1
Merge medio
8 h 14 min
PR fusionados (30 d)
3

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/Spackle

Todos los issues de TMHSDigital/Spackle

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.