logoalt Hacker News

Yokohiiiyesterday at 2:52 AM2 repliesview on HN

I recently tried to create markdown like parser, I had to refer a lot to common marks. What I saw was madness. I never knew from casual use, that markdown is so complex. There is literally zero thought about parsing, it forces natural looking text into a format that can be structured into actual markup, but it has so many pitfalls and edge cases that it just feels wrong. Each time I've looked up another markdown parser I was stunned how overegineered they are. If you need an AST to parse something seemingly simple like markdown, then something went wrong. Probably every coreutil is smaller then the average markdown parser. Why?


Replies

bronlundyesterday at 10:30 AM

Because Markdown is made for humans, not for machines.

fg137yesterday at 6:03 PM

> If you need an AST to parse something seemingly simple like markdown, then something went wrong.

This may surprise you, but that is very common in programming languages.

show 1 reply