Rewrite srcset attributes inside wicket:link

Abierto
#1,952 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@aryankalantri ya está trabajando en esto.

Desde el 21/11/2026.

  • #1977 de @aryankalantri — abierto
  • #1986 de @abduladnan-mt7 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
web-dev

Línea de trabajo

Read RelativePathPrefixHandler.java, especially the attributeNames array and its use, then check the auto-link resolver for how src is handled. Add coverage beside the existing tests in RelativePathPrefixHandlerTest.java for srcset on img and source. Done means relative URLs are rewritten while each descriptor is preserved.

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

Descripción

good first issue

Inside <wicket:link> (and for relative paths in general), Wicket rewrites the URLs in href, src and background attributes so they resolve relative to the page's package. The srcset attribute of <img> and <source> is not rewritten, so responsive images in static markup break.

Where

wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java, the attributeNames array and the code that uses it. Check also how <wicket:link> resolves src (the auto-link resolver) to see whether srcset needs handling there too.

srcset is not a single URL but a comma-separated list of url descriptor pairs, for example small.jpg 480w, large.jpg 1080w. Each URL needs rewriting and the descriptors must be kept.

Done when

  • Relative URLs in srcset on <img> and <source> are rewritten the same way as src, with the descriptors kept.
  • Tests next to the existing ones in wicket-core-tests/src/test/java/org/apache/wicket/markup/parser/RelativePathPrefixHandlerTest.java.

Background

Originally reported as WICKET-6326 (Wicket 8.0).


Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.

Lenguaje dominante
Java
Estrellas
800
Forks
437
Merge medio
21 h 36 min
PR fusionados (30 d)
167

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 apache/wicket

Todos los issues de apache/wicket

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.