{"action":"created","issue":{"url":"https://api.github.com/repos/mkdocs/mkdocs/issues/1220","repository_url":"https://api.github.com/repos/mkdocs/mkdocs","labels_url":"https://api.github.com/repos/mkdocs/mkdocs/issues/1220/labels{/name}","comments_url":"https://api.github.com/repos/mkdocs/mkdocs/issues/1220/comments","events_url":"https://api.github.com/repos/mkdocs/mkdocs/issues/1220/events","html_url":"https://github.com/mkdocs/mkdocs/issues/1220","id":227215097,"number":1220,"title":"Support question mark in edit_uri","user":{"login":"ovasquez","id":7527242,"avatar_url":"https://avatars3.githubusercontent.com/u/7527242?v=3","gravatar_id":"","url":"https://api.github.com/users/ovasquez","html_url":"https://github.com/ovasquez","followers_url":"https://api.github.com/users/ovasquez/followers","following_url":"https://api.github.com/users/ovasquez/following{/other_user}","gists_url":"https://api.github.com/users/ovasquez/gists{/gist_id}","starred_url":"https://api.github.com/users/ovasquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovasquez/subscriptions","organizations_url":"https://api.github.com/users/ovasquez/orgs","repos_url":"https://api.github.com/users/ovasquez/repos","events_url":"https://api.github.com/users/ovasquez/events{/privacy}","received_events_url":"https://api.github.com/users/ovasquez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-09T00:42:29Z","updated_at":"2017-05-09T01:27:00Z","closed_at":null,"body":"The `edit_uri` setting in the `mkdocs.yml` file doesn't support the question mark, which is a valid and very common character in URLs. When a '?' is used the edit_uri contents are ignored and the edit URL is incorrectly generated.\r\n\r\nThis approach is used in the _Visual Studio Team Services_ git repository, so it would be really helpful to be able to link the files.\r\nFor example: \r\n```\r\nedit_uri: '?path=/website/docs/'\r\n```\r\nThis also happens if the '?' is added in the `repo_url` setting."},"comment":{"url":"https://api.github.com/repos/mkdocs/mkdocs/issues/comments/300035496","html_url":"https://github.com/mkdocs/mkdocs/issues/1220#issuecomment-300035496","issue_url":"https://api.github.com/repos/mkdocs/mkdocs/issues/1220","id":300035496,"user":{"login":"waylan","id":78846,"avatar_url":"https://avatars0.githubusercontent.com/u/78846?v=3","gravatar_id":"","url":"https://api.github.com/users/waylan","html_url":"https://github.com/waylan","followers_url":"https://api.github.com/users/waylan/followers","following_url":"https://api.github.com/users/waylan/following{/other_user}","gists_url":"https://api.github.com/users/waylan/gists{/gist_id}","starred_url":"https://api.github.com/users/waylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waylan/subscriptions","organizations_url":"https://api.github.com/users/waylan/orgs","repos_url":"https://api.github.com/users/waylan/repos","events_url":"https://api.github.com/users/waylan/events{/privacy}","received_events_url":"https://api.github.com/users/waylan/received_events","type":"User","site_admin":false},"created_at":"2017-05-09T01:27:00Z","updated_at":"2017-05-09T01:27:00Z","body":"This appears to be the behavior of `urljoin`:\r\n\r\n>>> urljoin('http://example.com/foo/bar', 'baz/blah.txt')\r\n'http://example.com/foo/baz/blah.txt'\r\n>>> urljoin('http://example.com/?path=/foo/bar', 'baz/blah.txt')\r\n'http://example.com/baz/blah.txt'\r\n\r\nThe first example is what we anticipated. The first string points to the location and the second string is the path from the document root to the file. But when the first string includes a query string (part that starts with `?`) then is strips that part out as we see in the second example. This actually makes sense. It would be wrong to have a query string in the middle of a URL and `joinurl` wouldn't necessarily consider that you might want to join a string to the query string. Consider this example:\r\n\r\nurljoin('http://example.com/', '?path=/foo/bar', 'baz/blah.txt')\r\n'http://example.com/?path=/foo/bar'\r\n\r\nThere it adds the query string, but then ignores everything after it. Looking at the [source], we don't use `joinurl` to join the repo_url and the edit_url, but we do use joinurl to join the file path to the combined repo_url/edit_url.\r\n\r\n[source]: https://github.com/mkdocs/mkdocs/blob/b3ca24234b5cbd29d401dd8477fe0d9a7c8f48a4/mkdocs/nav.py#L214-L216\r\n"}}
{"actor":{"display_login":"waylan"}}