Tring to fix a bug in elm-markup: infinite loop by '{'

I have been playing around with Elm-Markup and found it is for my purposes a big step forward from Markdown. However, there is one issue, there is a known bug that when the markup parser is fed a single ‘{’ character, the app gets stuck in an infinite loop :ghost: ( Ellie demo). I thought it could be a nice exercise to improve my understanding of parsers by trying to fix the bug, however I got stuck on two issues:

  1. It seems that the source code of “elm-markup” on packages.elm.org and the github repo are not the same. I can compile the examples only, if I replace the examples elm.json and supply them with the “official” package instead of that of the Github repo, so something got out of sync?

  2. Is there a clever strategy to debug these type of infinite loops? My intuition is to search for whatever parser deals with ‘{’ chars and test them one by one. Does anybody have a hint on what functions within elm/Parser are likely to trigger infinite loops?

1 Like

Have found that removing this line at least solves the infinite loop, and doesn’t seem to break anything too essential, so good… for now.

What a coincidence :laughing:. I met the same bug yesterday

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.