Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat: render hooks for links and images

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend, testing

Direzione di ricerca

Start with the pipeline in Fanstatic/Helpers/SiteHelper.cs:18-20 and its use in Page.cs:430; then inspect the existing Markdig renderers and test patterns in Fanstatic.Test/, using .TestSites/ for a fixture. Run ./build.sh test and add coverage for site- and theme-level hooks, unchanged output without hooks, and per-site thread safety. Done means the [Pentiment](_rating) fixture renders through the hook using site.Data, and the stated coverage and CRAP thresholds are met.

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

Descrizione

c:templates p:high size:M t:feature

Part of the Phase 3 epic (#33).

Current State

Markdown links and images always render with Markdig's default HTML. The pipeline is a static singleton
(Fanstatic/Helpers/SiteHelper.cs:18-20) used by Page.cs:430, so sites cannot change the output.

Tasks:
  • When _markup/render-link.html / _markup/render-image.html exists (site, then theme), render
    LinkInline nodes through it instead of Markdig's renderer (custom HtmlObjectRenderer<LinkInline>)
  • Context: link.Destination, link.Text (rendered inline HTML), link.PlainText, link.Title,
    link.IsExternal, link.IsImage, plus page and site
  • The pipeline/renderer must be per site (not static) and thread-safe
  • Hook template errors are reported with the hook path and the page (see #3)
  • Tutorial on the docs site: the _rating example with site.Data

Tests live in Fanstatic.Test/ (xUnit + NSubstitute); fixture sites in .TestSites/. Run ./build.sh test; new/changed methods need CRAP ≤ 15 and ≥ 75 % line coverage.

Acceptance Criteria:
  • Fixture site: [Pentiment](_rating) renders through the hook using site.Data; other links unchanged.
  • Sites without hooks produce byte-identical output.
Related:
  • #33 (Phase 3 epic, parent)
  • Depends on #31
  • Depends on #40
Lingua principale
C#
Stelle
1
Fork
0
Merge medio
13h 50m
PR unite (30g)
3

Preparare l'ambiente

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 MASS4ORG/Fanstatic

Tutte le issue di MASS4ORG/Fanstatic

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.