hhvm / fbmarkdown

Pure-Hack implementation of GitHub Flavored Markdown, based on the specification at https://github.github.com/gfm/
MIT License
29 stars 11 forks source link

Add optional AST node limit #17

Open fredemmott opened 4 years ago

fredemmott commented 4 years ago

It's pretty reasonable to attempt parsing any text as markdown; right now, this will lead to request-level limits such as memory or time. It'd be better to support a complexity limit within the parser, e.g. if there's a million AST nodes something's probably wrong and it should be treated as plain text.