Article teaser in a tag index or page list: a link in the excerpt makes a link inside a link

Aperta
#695 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@guidol-ive ci sta già lavorando.

Dal 29/10/2026.

  • #699 di @guidol-ive — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

Start with peer_reviewed_article::renderExcerpt() and compare it with renderExcerptBody(); the issue says the former is called inside links from tagindex::renderPage() and PagelistMacro::renderPage(). Check how excerpt links are represented and how the article page preview uses the body. Done means list excerpts no longer contain nested links while links remain in the article page preview; linked PR #699 is already open.

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

Descrizione

Component: User interface Impact: Medium Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors

A tag index and a page list show every article as a link around its teaser: title, author, date, featured image and excerpt. When the excerpt itself holds a link, the page has a link inside a link:

<li class="tagindex-item"><a href="nl/Article">
  <h2 class="title">…</h2>
  <div class="excerpt"><div class="excerpt_body"><p>Part of <a href="https://example.org/">https://example.org/</a>.</p></div></div>
</a></li>

A link inside a link is invalid HTML. The browser's parser closes the outer link at the inner one and reopens it, so the DOM ends up with an empty link and a teaser that is cut in two. Screen readers announce a link without a name; axe reports link-name (WCAG 2.4.4, 4.1.2), and so does Lighthouse.

On a test copy of a site with about 1,200 public pages, axe found it on about 2,250 pages, most of them through the lists in the sidebar.

tagindex::renderPage() and PagelistMacro::renderPage() both put renderExcerpt() in an <a>; peer_reviewed_article::renderExcerptBody() copies the excerpt as it is.

Fix: peer_reviewed_article::renderExcerpt(), which is only called inside such a link, replaces each link of the excerpt with its content. The article page itself (the preview of renderExcerptBody()) keeps the links.

🤖 Generated with Claude Code

Lingua principale
JavaScript
Stelle
5
Fork
9
Merge medio
18h 49m
PR unite (30g)
13

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 PlanBCode/hypha

Tutte le issue di PlanBCode/hypha

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.