{"action":"created","issue":{"url":"https://api.github.com/repos/eush77/mdast/issues/1","labels_url":"https://api.github.com/repos/eush77/mdast/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/eush77/mdast/issues/1/comments","events_url":"https://api.github.com/repos/eush77/mdast/issues/1/events","html_url":"https://github.com/eush77/mdast/pull/1","id":111719085,"number":1,"title":"Refactor","user":{"login":"wooorm","id":944406,"avatar_url":"https://avatars.githubusercontent.com/u/944406?v=3","gravatar_id":"","url":"https://api.github.com/users/wooorm","html_url":"https://github.com/wooorm","followers_url":"https://api.github.com/users/wooorm/followers","following_url":"https://api.github.com/users/wooorm/following{/other_user}","gists_url":"https://api.github.com/users/wooorm/gists{/gist_id}","starred_url":"https://api.github.com/users/wooorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooorm/subscriptions","organizations_url":"https://api.github.com/users/wooorm/orgs","repos_url":"https://api.github.com/users/wooorm/repos","events_url":"https://api.github.com/users/wooorm/events{/privacy}","received_events_url":"https://api.github.com/users/wooorm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T22:14:40Z","updated_at":"2015-10-16T10:16:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eush77/mdast/pulls/1","html_url":"https://github.com/eush77/mdast/pull/1","diff_url":"https://github.com/eush77/mdast/pull/1.diff","patch_url":"https://github.com/eush77/mdast/pull/1.patch"},"body":"Okay! Here goes. Most of this is just syntactic rewrite to how I like my code, which is just to ensure I don’t have to change small stuff in the future (e.g., setting variable declarations at the top of a scope, strict equality checks), but also because it helps me understand the code.\r\n\r\nThe most important change has to do with regexes: I’m trying to minimise those and rewrote the `escape` method to use an algorithm instead. I also tried my hand at `unescapeShortcutLinkRefer` (but didn’t get it working yet, and time is running out today). That’s a funky function, for example, I’m not sure what the `+` does in the regex for `PUNCTUATION`? Does it ensure the backslash is included?\r\n\r\nAnyway, it doesn’t work yet, but I was hoping with your understanding of the regex and the function could get it to work? If not, just cherry pick this commit and ignore that function!"},"comment":{"url":"https://api.github.com/repos/eush77/mdast/issues/comments/148675760","html_url":"https://github.com/eush77/mdast/pull/1#issuecomment-148675760","issue_url":"https://api.github.com/repos/eush77/mdast/issues/1","id":148675760,"user":{"login":"wooorm","id":944406,"avatar_url":"https://avatars.githubusercontent.com/u/944406?v=3","gravatar_id":"","url":"https://api.github.com/users/wooorm","html_url":"https://github.com/wooorm","followers_url":"https://api.github.com/users/wooorm/followers","following_url":"https://api.github.com/users/wooorm/following{/other_user}","gists_url":"https://api.github.com/users/wooorm/gists{/gist_id}","starred_url":"https://api.github.com/users/wooorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooorm/subscriptions","organizations_url":"https://api.github.com/users/wooorm/orgs","repos_url":"https://api.github.com/users/wooorm/repos","events_url":"https://api.github.com/users/wooorm/events{/privacy}","received_events_url":"https://api.github.com/users/wooorm/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T10:16:31Z","updated_at":"2015-10-16T10:16:31Z","body":"Regarding the `+` in `PUNCTUATION`, I think I was a bit vague there. I didn’t mean the `+` inside the capturing group, rather, the `+` outside it ([just before the `/g`](https://github.com/eush77/mdast/blob/7b92078711a17f21264fe98381ee1c5539bdc455/lib/stringify.js#L70)). Wouldn’t that catch more characters (for example, `'--:;'`) than needed?\r\n\r\nI think I’m understanding what happens in the `unescape` function: It takes all characters from `value`, except for backslashes, which come (or not) from `identifier`?"}}