fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
525 stars 55 forks source link

hang on very long line #122

Closed abartov closed 12 years ago

abartov commented 12 years ago

Possibly related to #121, a different input file with one huge line (Alice in Wonderland with the newlines removed) resulted in a hang on my machine. The file is at http://benyehuda.org/~asaf/one_huge_line.txt and is http://www.gutenberg.org/cache/epub/11/pg11.txt without the line breaks.

fletcher commented 12 years ago

That file is a mess:

1) You stripped newlines but did not insert spaces, causing runon words

2) "hrule" lines persist, leaving series of "" characters in the middle of a line (e.g. "foo * * * * * * * * \ bar"). This will cause a problem with MMD.

If you use latest development branch (with built in timeout function that works on Mac, but not on Windows/*nix yet), MMD will fail with an error message after 3 seconds. But this file will not parse correctly no matter what, since it really becomes rather ambiguous what the intent is as a single line.