jgm/peg-markdown

bad code block hangs peg-markdown

isao opened this issue · 2 comments

isao commented

I just made peg-markdown hang when, by mistake, I neglected to indent the initial curly brace in the following JSON code block. To reproduce, remove the two leading tabs on the line containing the first curly brace. Best regards --Isao

+begin tab-indented sample+

In this example, the bob's Memberships Collection now contains the newly created group:

    {
      "id":2,
      "username":"bob",
      "passhash":"401c30e3eb8693eb282d5a378e3edf11201933fc",
      "mobile_no":"14087591828",
      "email":"bob@mailinator.com",
      "carrier_id":"7",
      "is_verified":1,
      "is_active":1,
      "is_quiet":0,
      "quiet_start_time":0,
      "quiet_end_time":0,
      "created":1264015711,
      "updated":1264015711,
      "Memberships":{
        "2":{
          "group_id":2,
          "status":"joined",
          "is_active":1,
          "is_admin":1,
          "created":1264013960,
          "updated":1264013960,
          "name":"team_bobby",
          "description":"ricky bobby is a winner-- you on his team?",
          "is_public":0,
          "new_user_priv":"send-receive",
          "group_created":1264013960,
          "group_updated":1264013960
        },
        "4":{
          "group_id":4,
          "status":"joined",
          "is_active":1,
          "is_admin":0,
          "created":1264016105,
          "updated":1264016105,
          "name":"abcd",
          "description":"a group for you,
           if your name is in the first four letter of the alphabet",
          "is_public":1,
          "new_user_priv":"send-receive",
          "group_created":1264015827,
          "group_updated":1264015827
        },
        "5":{
          "group_id":5,
          "status":"joined",
          "is_active":1,
          "is_admin":1,
          "created":1266542158,
          "updated":1266542158,
          "name":"disabel",
          "description":"dis abel-- that jerk",
          "is_public":1,
          "new_user_priv":"send-receive",
          "group_created":1266542158,
          "group_updated":1266542158
        }
      }
    }

+end tab-indented sample+

jgm commented

Problem confirmed with input like this:

aaa_bbb_ccc_ddd_eee_fff
aaa_bbb_ccc_ddd_eee_fff
aaa_bbb_ccc_ddd_eee_fff
aaa_bbb_ccc_ddd_eee_fff

Fixed in commit fda0bf4

isao commented

wow, that was fast! thanks John