{"action":"created","issue":{"url":"https://api.github.com/repos/kasparsd/minit/issues/87","repository_url":"https://api.github.com/repos/kasparsd/minit","labels_url":"https://api.github.com/repos/kasparsd/minit/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/kasparsd/minit/issues/87/comments","events_url":"https://api.github.com/repos/kasparsd/minit/issues/87/events","html_url":"https://github.com/kasparsd/minit/issues/87","id":178633088,"number":87,"title":"root relative urls in css are being meesed up","user":{"login":"diegodorado","id":208685,"avatar_url":"https://avatars.githubusercontent.com/u/208685?v=3","gravatar_id":"","url":"https://api.github.com/users/diegodorado","html_url":"https://github.com/diegodorado","followers_url":"https://api.github.com/users/diegodorado/followers","following_url":"https://api.github.com/users/diegodorado/following{/other_user}","gists_url":"https://api.github.com/users/diegodorado/gists{/gist_id}","starred_url":"https://api.github.com/users/diegodorado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegodorado/subscriptions","organizations_url":"https://api.github.com/users/diegodorado/orgs","repos_url":"https://api.github.com/users/diegodorado/repos","events_url":"https://api.github.com/users/diegodorado/events{/privacy}","received_events_url":"https://api.github.com/users/diegodorado/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kasparsd/minit/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-22T14:55:11Z","updated_at":"2016-09-22T15:12:25Z","closed_at":null,"body":"I have to change minit-css.php on line 88, because root relative urls were being messed up.\r\n\r\nthis is what i changed:\r\n\r\n```\r\n// Make all local asset URLs absolute\r\n\t\t$content = preg_replace(\r\n\t\t\t'/url\\([\"\\' ]?+(?!data:|https?:|\\/\\/|\\/)(.*?)[\"\\' ]?\\)/i',\r\n\t\t\tsprintf( \"url('%s/$1')\", $this->handler->base_url . dirname( $src ) ),\r\n\t\t\t$content\r\n\t\t);\r\n```\r\n\r\nNote the `|\\/` addition to the regex, to avoid replacing root relative urls.\r\n\r\nI understand that having root relative urls in css isnt a very good practice, at least for wordpress, but it happened that i already have them.\r\n\r\nBeside that, the plugin is absolutly great as simple! Just what i needed\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/kasparsd/minit/issues/comments/248933041","html_url":"https://github.com/kasparsd/minit/issues/87#issuecomment-248933041","issue_url":"https://api.github.com/repos/kasparsd/minit/issues/87","id":248933041,"user":{"login":"diegodorado","id":208685,"avatar_url":"https://avatars.githubusercontent.com/u/208685?v=3","gravatar_id":"","url":"https://api.github.com/users/diegodorado","html_url":"https://github.com/diegodorado","followers_url":"https://api.github.com/users/diegodorado/followers","following_url":"https://api.github.com/users/diegodorado/following{/other_user}","gists_url":"https://api.github.com/users/diegodorado/gists{/gist_id}","starred_url":"https://api.github.com/users/diegodorado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegodorado/subscriptions","organizations_url":"https://api.github.com/users/diegodorado/orgs","repos_url":"https://api.github.com/users/diegodorado/repos","events_url":"https://api.github.com/users/diegodorado/events{/privacy}","received_events_url":"https://api.github.com/users/diegodorado/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T15:12:24Z","updated_at":"2016-09-22T15:12:24Z","body":"Sure:\r\n\r\nsay I have a style.css file inside wp-content/themes/mytheme/ with the following rule\r\n\r\n`\r\nsome.selector{\r\n  background: url(/wp-content/uploads/some-img.jpg);\r\n}\r\n`\r\n\r\n(I know, I know.... bad practices)\r\n\r\nthen, after minit run,  it concat\r\nsite_url + css_path + content, so and I end up with\r\n\r\n`\r\nsome.selector{\r\n  background: url(http://mysite.url/wp-content/themes/mytheme//wp-content/uploads/some-img.jpg);\r\n}\r\n`\r\n\r\nAnyway, good or bad practice, I think that following urls shouldnt be touched:\r\n\r\n- absolute urls (done)\r\n- protocol relative urls (done)\r\n- root relative urls (this was missing)\r\n\r\n"}}
{"actor":{"display_login":"diegodorado"}}