Rewrite srcset attributes inside wicket:link

Aperta
#1,952 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@aryankalantri ci sta già lavorando.

Dal 21/11/2026.

  • #1977 di @aryankalantri — aperta
  • #1986 di @abduladnan-mt7 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
web-dev

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
800
Fork
437
Merge medio
21h 36m
PR unite (30g)
167

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/wicket

Tutte le issue di apache/wicket

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.