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

Markdown handling & marked script handling

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript

Direzione di ricerca

Inizia individuando il percorso di rendering fileData.extension === 'md', il riferimento al CDN di marked e il controllo del codice sorgente/formattato esistente di Prettier. Confronta le opzioni proposte per la visualizzazione Markdown e le modifiche al caricamento degli script; il lavoro dovrebbe considerarsi completato quando sarà stata concordata un’esperienza di visualizzazione del sorgente/formattata e sarà stato confermato che la gestione di Markdown non comporta più costi di caricamento non necessari.

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

Descrizione

improvement

The way runpkg currently works, viewing a markdown (.md) file shows us the formatted version, thanks to the marked markdown parser.

Problems:

  1. Currently there's no way to view the source of a markdown file on runpkg. We just render the formatted version if fileData.extension === 'md' and there's no way to disable this.
  2. In running some lighthouse performance tests, it does seem that - although it's not the heaviest package - loading this script has a noticeable impact on performance metrics like TTI. This seems an unnecessary price to pay when it's likely that most pages viewed are not markdown.
  3. Bonus: is there a particular reason we're using jsdelivr over unpkg to serve this script? If not, it seems in the spirit of this project to move from using https://cdn.jsdelivr.net/npm/marked/marked.min.js to https://unpkg.com/[email protected]/marked.min.js or https://unpkg.com/marked/marked.min.js

Proposals:

  1. Make formatted/source view similar to what we do for prettier. My thoughts would be to a) add a checkbox to toggle formatted/source view, b) add a button similar to the prettier formatting button to format markdown, or c) change the prettier button to be a "format markdown" button when viewing markdown (the same as b, but saving space with the downside of no markdown prettification)
  2. If we tackle proposal 1, we can then defer/async the script
  3. Move to using https://unpkg.com/[email protected]/marked.min.js

Thoughts?

Lingua principale
JavaScript
Stelle
307
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 FormidableLabs/runpkg

Tutte le issue di FormidableLabs/runpkg

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.