Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Links like `mailto:` and `../` break on translated pages (e.g. the Code of Conduct report email)

Abierto Apto para principiantes
#1,631 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

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
node.js, typescript

Línea de trabajo

Empieza con ensureCorrectLocalePrefixesInHtmlLinks en src/middleware.ts y comprueba cómo gestiona los enlaces relativos a la raíz, los enlaces relativos y los enlaces mailto:. Añade pruebas unitarias para los casos descritos en el issue, luego vuelve a compilar y comprueba las páginas traducidas afectadas. El trabajo estará terminado cuando los enlaces relativos a la raíz reciban el prefijo de locale, mientras que los enlaces mailto: y ../ permanezcan sin cambios.

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

Descripción

Most appropriate sections of the p5.js website?

Other (specify if possible): Code of Conduct, Privacy Policy, Terms of Use, and tutorials, in the translated versions

What is your operating system?

Linux

Web browser and version

152.0.7977.64

This is not browser specific. The wrong link is already in the HTML the server sends.

Actual Behavior

On pages in Spanish, Hindi, Korean and Chinese, some links get a language prefix they shouldn't have.

For example, on https://p5js.org/es/code-of-conduct/ the "report by email" link points to:

/es/mailto:[email protected]

This is not an email link anymore, so clicking it does nothing useful. The same happens for [email protected] on the Privacy Policy page and [email protected] on the Terms of Use page, in all four languages.

Relative links are also affected. In the Korean tutorial /ko/tutorials/lights-camera-materials/, the link ../intro-to-shaders/ becomes /ko/../intro-to-shaders/. The browser turns that into /intro-to-shaders/, which does not exist.

I crawled a local build of the site. I found 42 mailto: links and about 97 ../ links that are broken only because of this.

The cause is ensureCorrectLocalePrefixesInHtmlLinks in src/middleware.ts. It adds /<locale> to every link except ones that start with http, ./ or #. So mailto: and ../ links get changed too.

Expected Behavior
  • mailto: links should stay as they are.
  • Relative links like ../foo/ should be left alone. The browser already resolves them correctly from the translated page URL.
  • Only root-relative links such as /reference/ should get the language prefix.
Steps to reproduce
  1. Open https://p5js.org/es/code-of-conduct/ (or /hi/, /ko/, /zh-Hans/).
  2. Look at the email link in the "report" paragraph. Its href is /es/mailto:[email protected].
  3. Compare with https://p5js.org/code-of-conduct/, where it is mailto:[email protected].
Would you like to work on the issue?

Yes. I'd change the middleware so it only prefixes root-relative links, and add unit tests for it (there are none right now). I'll rebuild and re-check the links on all four languages before opening a PR. I'll wait for approval before starting.

Note: PR #997 also edits this function, but for a different reason (trailing slashes on external links). I'd rebase on it if it lands first.

AI disclosure: I used Claude to help find and investigate this bug. The findings were checked against the live site and a local build.

Lenguaje dominante
MDX
Estrellas
97
Forks
330
Merge medio
4 d 18 h
PR fusionados (30 d)
11

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 processing/p5.js-website

Todos los issues de processing/p5.js-website

Issues similares

Más issues de Internationalization

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.