{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/commonmark.js/issues/9","labels_url":"https://api.github.com/repos/jgm/commonmark.js/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/jgm/commonmark.js/issues/9/comments","events_url":"https://api.github.com/repos/jgm/commonmark.js/issues/9/events","html_url":"https://github.com/jgm/commonmark.js/issues/9","id":58498684,"number":9,"title":"Fix url normalizer","user":{"login":"puzrin","id":319465,"avatar_url":"https://avatars.githubusercontent.com/u/319465?v=3","gravatar_id":"","url":"https://api.github.com/users/puzrin","html_url":"https://github.com/puzrin","followers_url":"https://api.github.com/users/puzrin/followers","following_url":"https://api.github.com/users/puzrin/following{/other_user}","gists_url":"https://api.github.com/users/puzrin/gists{/gist_id}","starred_url":"https://api.github.com/users/puzrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puzrin/subscriptions","organizations_url":"https://api.github.com/users/puzrin/orgs","repos_url":"https://api.github.com/users/puzrin/repos","events_url":"https://api.github.com/users/puzrin/events{/privacy}","received_events_url":"https://api.github.com/users/puzrin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-22T10:57:45Z","updated_at":"2015-02-22T11:03:56Z","closed_at":null,"body":"Discussed here https://github.com/jgm/CommonMark/issues/270\r\n\r\nMy last attempt to use `url` for honest parse caused tons of broken tests (see https://github.com/jgm/CommonMark/issues/270#issuecomment-75429014):\r\n\r\n1. It always add missed `/` after domain name (`http://example.com?abc` -> `http://example.com/?abc`)\r\n2. It replaces `\\` with `/` in query `http://example.com?abc` https://github.com/joyent/node/commit/f7ede33f09187cd9b1874982e813380cd292ef17\r\n\r\nNeed to decide, what to do with (tests|spec|implementation). I've stopped working on this issue, until direction given. Code is available in separate branch https://github.com/markdown-it/markdown-it/commits/normalize (last commit).\r\n\r\nExample:\r\n\r\n```bash\r\nnode -e \"console.log(require('url').parse('http://example.com?foo'))\"\r\n```\r\n=>\r\n```\r\n{ protocol: 'http:',\r\n  slashes: true,\r\n  auth: null,\r\n  host: 'example.com',\r\n  port: null,\r\n  hostname: 'example.com',\r\n  hash: null,\r\n  search: '?foo',\r\n  query: 'foo',\r\n  pathname: '/',\r\n  path: '/?foo',\r\n  href: 'http://example.com/?foo' }\r\n```\r\nsee `href`"},"comment":{"url":"https://api.github.com/repos/jgm/commonmark.js/issues/comments/75430150","html_url":"https://github.com/jgm/commonmark.js/issues/9#issuecomment-75430150","issue_url":"https://api.github.com/repos/jgm/commonmark.js/issues/9","id":75430150,"user":{"login":"puzrin","id":319465,"avatar_url":"https://avatars.githubusercontent.com/u/319465?v=3","gravatar_id":"","url":"https://api.github.com/users/puzrin","html_url":"https://github.com/puzrin","followers_url":"https://api.github.com/users/puzrin/followers","following_url":"https://api.github.com/users/puzrin/following{/other_user}","gists_url":"https://api.github.com/users/puzrin/gists{/gist_id}","starred_url":"https://api.github.com/users/puzrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puzrin/subscriptions","organizations_url":"https://api.github.com/users/puzrin/orgs","repos_url":"https://api.github.com/users/puzrin/repos","events_url":"https://api.github.com/users/puzrin/events{/privacy}","received_events_url":"https://api.github.com/users/puzrin/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T11:03:56Z","updated_at":"2015-02-22T11:03:56Z","body":"Example with `\\` replacement:\r\n\r\n```bash\r\nnode -e \"console.log(require('url').parse('http://example.com?foo\\\\\\\\*'))\"\r\n```\r\n=>\r\n```js\r\n{ protocol: 'http:',\r\n  slashes: true,\r\n  auth: null,\r\n  host: 'example.com',\r\n  port: null,\r\n  hostname: 'example.com',\r\n  hash: null,\r\n  search: '?foo/*',\r\n  query: 'foo/*',\r\n  pathname: '/',\r\n  path: '/?foo/*',\r\n  href: 'http://example.com/?foo/*' }\r\n```\r\nsee `href`"}}