Links like `mailto:` and `../` break on translated pages (e.g. the Code of Conduct report email)
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
- Área
- internationalization, web-dev
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
- Open https://p5js.org/es/code-of-conduct/ (or
/hi/,/ko/,/zh-Hans/). - Look at the email link in the "report" paragraph. Its
hrefis/es/mailto:[email protected]. - 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de processing/p5.js-website
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
processing/p5.js-website#1619 ·
Los mantenedores suelen responder en 2 días
-
`<canvas>` tag rendered instead of escaped in `p5.Graphics` reference pageQuizá libre de nuevo @rakesh2OO5 la tomó hace 130 días y no hay ningún pull request abierto. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
processing/p5.js-website#1389 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Add Korean translations for `layered-rendering-with-framebuffers.mdx`Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
processing/p5.js-website#1374 ·
Los mantenedores suelen responder en 2 días
-
Add Korean translations for `intro-to-p5-strands.mdx`Posiblemente ocupada @eupthere la tomó hace 185 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
processing/p5.js-website#1356 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
[2.0] TutorialLayout.astro is missing the showBanner translation featurePosiblemente ocupada @kramosss la tomó hace 92 días. AbiertoBug Reserved (CodeDay)
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
processing/p5.js-website#1329 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de processing/p5.js-website
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
[Sync EN] Document the missing errors for extract, array_multisort, base_convert and log (#6007)Posiblemente ocupada @lacatoire la tomó hace 1 día. Abiertosync-en
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Translate the app into ItalianAbiertoenhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
omlahore/RemoveMacAI#91 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
Dayset/ps2-elite-kd#64 ·