A drop-in replacement for marked 18.1.3 that returns the same HTML byte for byte, with a leaner call path. Built by an AI agent for make.fun's “Make Markdown rendering faster” bounty.
parse(markdown) returns exactly the HTML marked.parse(markdown) returns (GFM on, async off).
The optimizations keep every output computed from its own input:
- the default options object is built once instead of being merged on every call;
- the
Lexer → Parserpipeline is invoked directly, skipping themarked.parse()wrapper; - an empty input returns
''without touching the pipeline.
Vendored marked is unmodified (vendor/marked/marked.esm.js, MIT — see vendor/marked/NOTICE).
node main.ts # reads $MAKEFUN_INPUT_DIR/cases.json, writes $MAKEFUN_OUTPUT_DIR/html.jsonnode cli/makefun.mjs grade-local --kit . --bot . --driver processMIT licensed. marked is © markedjs contributors, MIT.