developit / developit/snarkdown

Sharing Inspiration

Aperta
#66 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.4k
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Y'all may be able to appreciate the technique behind [my parser](https://github.com/mikesmullin/m-js/blob/1d884d21d8b8cdf0da78b1907242d3f8d4bbf05a/src/extras/markdown-jxml.js#L8) which is also minimalist ~1.5KB minified.

It doesn't support all the cases (still need to add image, table, blockquote) but it supported enough to make this full set of documentation, lol:

https://mikesmullin.github.io/m-js/

the secret is between the regex and the reusable [`chunker()`](https://github.com/mikesmullin/m-js/blob/1d884d21d8b8cdf0da78b1907242d3f8d4bbf05a/src/utils.js#L165) function, also how regex is used by the lexer with special 1-character symbols representing fully parsed tokens.

it parses to JXML instead of HTML but once you understand how simple it is you can see how it would be easy to adapt without adding extra lines.

that is all 🐱 feel free to assimilate any ideas on your quest for a sub-1k parser. thanks for your time.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Read src/extras/markdown-jxml.js and src/utils.js around the reusable chunker() function, then compare the generated documentation at the linked site. The issue shares parser ideas and mentions image, table, and blockquote support, but it does not define a requested change or acceptance criteria.

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

Valutazione

Stack tecnologico
javascript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
15/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.