{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1866","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1866/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1866/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1866/events","html_url":"https://github.com/Automattic/wp-calypso/pull/1866","id":123093971,"number":1866,"title":"Editor: Prefix non-standalone URLs with \"http\"","user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Editor","name":"Editor","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Ready%20to%20Merge","name":"[Status] Ready to Merge","color":"d4fb79"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-19T15:56:54Z","updated_at":"2015-12-22T12:48:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1866","html_url":"https://github.com/Automattic/wp-calypso/pull/1866","diff_url":"https://github.com/Automattic/wp-calypso/pull/1866.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/1866.patch"},"body":"Fixes #1846 \r\n\r\nThis pull request seeks to add an \"http\" prefix to links that cannot be used standalone (i.e. those with schemas, or hashbang/query/slash prefixed URLs).\r\n\r\n__Implementation notes:__\r\n\r\nThe `wplink` plugin closely mirrors the behavior of the core equivalent plugin, which is why it is implemented the way it is. See original reference implementation:\r\n\r\nhttps://github.com/WordPress/WordPress/blob/e844695e121c1a01f43f312ecd539affb004f0eb/wp-includes/js/wplink.js#L87-L95\r\n\r\n__Testing instructions:__\r\n\r\n1. Navigate to the [Calypso post editor](http://calypso.localhost:3000/post)\r\n2. Select a site, if prompted\r\n3. Add some text to the editor content\r\n4. Highlight the text\r\n5. Click the Insert Link button in the editor toolbar\r\n6. Add URL text and click Add Link\r\n7. Note that...\r\n - If the URL in step 6 includes a schema, that schema is used\r\n - If the URL in step 6 starts with a hashbang, query parameter, or slash, it is not modified\r\n - Otherwise, an HTTP schema is prefixed"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/166609258","html_url":"https://github.com/Automattic/wp-calypso/pull/1866#issuecomment-166609258","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1866","id":166609258,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars.githubusercontent.com/u/1779930?v=3","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T12:48:47Z","updated_at":"2015-12-22T12:48:47Z","body":">Not from this PR but is intentional that we don't display the hashbang on the popover?\r\n\r\nYep, this is how it behaves in wp-admin too. The idea is that in the overlay display, the URL is trimmed to take up as little space is possible."}}