{"action":"created","issue":{"url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/50","labels_url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/50/comments","events_url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/50/events","html_url":"https://github.com/nesQuick/atom-wordcount/issues/50","id":115714204,"number":50,"title":"Hangs atom worker on triple backtick above long paragraph","user":{"login":"vsivsi","id":428642,"avatar_url":"https://avatars.githubusercontent.com/u/428642?v=3","gravatar_id":"","url":"https://api.github.com/users/vsivsi","html_url":"https://github.com/vsivsi","followers_url":"https://api.github.com/users/vsivsi/followers","following_url":"https://api.github.com/users/vsivsi/following{/other_user}","gists_url":"https://api.github.com/users/vsivsi/gists{/gist_id}","starred_url":"https://api.github.com/users/vsivsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsivsi/subscriptions","organizations_url":"https://api.github.com/users/vsivsi/orgs","repos_url":"https://api.github.com/users/vsivsi/repos","events_url":"https://api.github.com/users/vsivsi/events{/privacy}","received_events_url":"https://api.github.com/users/vsivsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-08T07:15:26Z","updated_at":"2015-11-08T08:32:46Z","closed_at":null,"body":"Hi, this seems like a great package, but I just installed and started using it while editing a large markdown project and suddenly started getting weird hangs whenever I type triple backticks to start a fenced codeblock. I immediately suspected this package because I had only just started using it when the hangs started happening, but I have since spent the past hour really narrowing it down and I'm convinced it's just wordcount.  I've tried disabling all community packages, and then everything is fine.  If I then enable *just* wordcount, the hang starts happening.  If I enable all community packages *except* workdcount, everything is fine. Enable wordcount?  Hangs.\r\n\r\nHere's my repo:  Lauch Atom fresh with wordcount previously enabled.\r\n\r\n1.  Paste in a long paragraph of text (no line breaks), like some sweet sweet hipster ipsum:\r\n\r\n```\r\nFanny pack shabby chic tacos whatever craft beer, lo-fi actually bushwick. Chia poutine biodiesel flannel, banh mi cornhole hoodie taxidermy listicle +1 disrupt. Listicle franzen tattooed, banjo everyday carry migas butcher bitters artisan readymade thundercats food truck yuccie. Mixtape lomo fashion axe, vinyl disrupt asymmetrical authentic chia sustainable letterpress pug pinterest tofu meh schlitz. Selfies bushwick meh williamsburg tote bag ethical mustache, pop-up roof party portland chia kinfolk. 3 wolf moon bushwick kinfolk, lo-fi vice venmo asymmetrical VHS. Cronut cold-pressed chillwave swag.\r\n```\r\n\r\n2.  Type: [command] [up-arrow] to go to the beginning of document.\r\n3.  Hit return twice (insert two blank lines).\r\n4.  Hit up-arrow twice (back to top of document)\r\n5.  Hit \\` (backtick)  You will get two due to autocomplete.\r\n6.  Hit \\` (backtick) again (overwrites the second one from above)\r\n7.  Hit \\` (backtick) again.\r\n8.  Profit.  Actually no, hang until the \"Editor is not responding\" modal popups up, then either wait forever, or click close to lose all your work since the last save.  I screenshot a whole page of text the first time this happened, so thankfully I just needed to type it in again...\r\n\r\nI have no idea why this is happening, but needless to say, I need to disable wordcount until something changes! "},"comment":{"url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/comments/154789386","html_url":"https://github.com/nesQuick/atom-wordcount/issues/50#issuecomment-154789386","issue_url":"https://api.github.com/repos/nesQuick/atom-wordcount/issues/50","id":154789386,"user":{"login":"vsivsi","id":428642,"avatar_url":"https://avatars.githubusercontent.com/u/428642?v=3","gravatar_id":"","url":"https://api.github.com/users/vsivsi","html_url":"https://github.com/vsivsi","followers_url":"https://api.github.com/users/vsivsi/followers","following_url":"https://api.github.com/users/vsivsi/following{/other_user}","gists_url":"https://api.github.com/users/vsivsi/gists{/gist_id}","starred_url":"https://api.github.com/users/vsivsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsivsi/subscriptions","organizations_url":"https://api.github.com/users/vsivsi/orgs","repos_url":"https://api.github.com/users/vsivsi/repos","events_url":"https://api.github.com/users/vsivsi/events{/privacy}","received_events_url":"https://api.github.com/users/vsivsi/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T08:32:46Z","updated_at":"2015-11-08T08:32:46Z","body":"Seems like a case of [catastrophic backtracking](https://stackoverflow.com/questions/13562435/infinite-loop-with-regex)...  \r\n\r\nModifying the triple backtick replace regex to add an end of string condition solves it.\r\n\r\n```\r\n/`{3}(.|\\s)*?(`{3}|$)/g\r\n```\r\n\r\nProcrastination achievement unlocked! "}}