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

Delegate node walking to others

Aperta
#267 3 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
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
tooling

Direzione di ricerca

Inizia esaminando l’interfaccia attuale di walker e il modo in cui l’AST parser produce l’output, quindi confronta gli approcci browser Document e JSDOM descritti nell’issue. Il lavoro sarà completato quando il parser costruirà direttamente un DOM, verrà rimosso l’ambito relativo a walker e i consumer potranno sanificare, interrogare, aggiungere o renderizzare il document risultante tramite le DOM APIs esistenti.

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

Descrizione

To reduce the scope of this package (easier to maintain), how about this:

  • Remove the walker interface. Instead, the AST parser builds into a real DOM directly.
    • On the browser, this would be an instance of Document (that's what e.g. DOM Parser would output).
    • In node, something like JSDOM can be used.
    • So either of those two would be a dependency for this library.
  • That way, any sanitization or other DOM modification could either use an existing library, such as DOMPurify or write their own code using e.g. myDocument.querySelectorAll.
  • Rendering to an HTML string be as simple as myDocument.innerHTML, and others will likely just append that doc into the DOM directly, without ever producing an HTML string (perf win).

This change would radically lower the scope of this package (building on the shoulder of giants; existing web APIs basically), and would still preserve everything that's unique about this library, which is markdown parsing.

Lingua principale
JavaScript
Stelle
1.6k
Fork
231
Merge medio
2g 17h
PR unite (30g)
2

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 commonmark/commonmark.js

Tutte le issue di commonmark/commonmark.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.