{"action":"created","comment":{"url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/comments/49203532","id":49203532,"diff_hunk":"@@ -0,0 +1,41 @@\n+require 'spec_helper'\n+\n+describe PDFKit::HTMLPreprocessor do","path":"spec/html_preprocessor_spec.rb","position":3,"original_position":3,"commit_id":"5733acbfcf9503ee68dc3ebc1f8550cebed85282","original_commit_id":"ccf9b81564f5894c45e2f9d855d0aeff3ea59290","user":{"login":"cdwort","id":1014482,"avatar_url":"https://avatars.githubusercontent.com/u/1014482?v=3","gravatar_id":"","url":"https://api.github.com/users/cdwort","html_url":"https://github.com/cdwort","followers_url":"https://api.github.com/users/cdwort/followers","following_url":"https://api.github.com/users/cdwort/following{/other_user}","gists_url":"https://api.github.com/users/cdwort/gists{/gist_id}","starred_url":"https://api.github.com/users/cdwort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdwort/subscriptions","organizations_url":"https://api.github.com/users/cdwort/orgs","repos_url":"https://api.github.com/users/cdwort/repos","events_url":"https://api.github.com/users/cdwort/events{/privacy}","received_events_url":"https://api.github.com/users/cdwort/received_events","type":"User","site_admin":false},"body":"I would like to see another quick test for when root_url & protocol are nil. This would be the case for when PDFKit is not being used as middleware & the user doesn't explicitly set root_url & protocol. It's a simple test that prevents unintentional breakage in the future.","created_at":"2016-01-08T16:01:42Z","updated_at":"2016-01-08T16:01:42Z","html_url":"https://github.com/pdfkit/pdfkit/pull/344#discussion_r49203532","pull_request_url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344","_links":{"self":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/comments/49203532"},"html":{"href":"https://github.com/pdfkit/pdfkit/pull/344#discussion_r49203532"},"pull_request":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344"}}},"pull_request":{"url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344","id":55399116,"html_url":"https://github.com/pdfkit/pdfkit/pull/344","diff_url":"https://github.com/pdfkit/pdfkit/pull/344.diff","patch_url":"https://github.com/pdfkit/pdfkit/pull/344.patch","issue_url":"https://api.github.com/repos/pdfkit/pdfkit/issues/344","number":344,"state":"open","locked":false,"title":"Honor `root_url` in core","user":{"login":"danbernier","id":13077,"avatar_url":"https://avatars.githubusercontent.com/u/13077?v=3","gravatar_id":"","url":"https://api.github.com/users/danbernier","html_url":"https://github.com/danbernier","followers_url":"https://api.github.com/users/danbernier/followers","following_url":"https://api.github.com/users/danbernier/following{/other_user}","gists_url":"https://api.github.com/users/danbernier/gists{/gist_id}","starred_url":"https://api.github.com/users/danbernier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbernier/subscriptions","organizations_url":"https://api.github.com/users/danbernier/orgs","repos_url":"https://api.github.com/users/danbernier/repos","events_url":"https://api.github.com/users/danbernier/events{/privacy}","received_events_url":"https://api.github.com/users/danbernier/received_events","type":"User","site_admin":false},"body":"@sigmavirus24 Here's a working solution for what I was proposing in #343.\r\n\r\nTo an end-user, the only effect is that the `:root_url` (and the `:protocol`) options now can be passed right to the PDFKit constructor. Configuring `root_url` still works, too.\r\n\r\nThis PR introduces `PDFKit::HtmlPreprocessor`, which could maybe also handle inserting the `<stylesheet>` tags, but I didn't want to change too much at once.\r\n\r\nWhat do you think?","created_at":"2016-01-07T22:23:16Z","updated_at":"2016-01-08T16:01:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d27717ded1a30f322444eccfdd7df863720a2708","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344/commits","review_comments_url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344/comments","review_comment_url":"https://api.github.com/repos/pdfkit/pdfkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pdfkit/pdfkit/issues/344/comments","statuses_url":"https://api.github.com/repos/pdfkit/pdfkit/statuses/5733acbfcf9503ee68dc3ebc1f8550cebed85282","head":{"label":"ContinuityControl:honor-root-url-in-core","ref":"honor-root-url-in-core","sha":"5733acbfcf9503ee68dc3ebc1f8550cebed85282","user":{"login":"ContinuityControl","id":442713,"avatar_url":"https://avatars.githubusercontent.com/u/442713?v=3","gravatar_id":"","url":"https://api.github.com/users/ContinuityControl","html_url":"https://github.com/ContinuityControl","followers_url":"https://api.github.com/users/ContinuityControl/followers","following_url":"https://api.github.com/users/ContinuityControl/following{/other_user}","gists_url":"https://api.github.com/users/ContinuityControl/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuityControl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuityControl/subscriptions","organizations_url":"https://api.github.com/users/ContinuityControl/orgs","repos_url":"https://api.github.com/users/ContinuityControl/repos","events_url":"https://api.github.com/users/ContinuityControl/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuityControl/received_events","type":"Organization","site_admin":false},"repo":{"id":1860292,"name":"pdfkit","full_name":"ContinuityControl/pdfkit","owner":{"login":"ContinuityControl","id":442713,"avatar_url":"https://avatars.githubusercontent.com/u/442713?v=3","gravatar_id":"","url":"https://api.github.com/users/ContinuityControl","html_url":"https://github.com/ContinuityControl","followers_url":"https://api.github.com/users/ContinuityControl/followers","following_url":"https://api.github.com/users/ContinuityControl/following{/other_user}","gists_url":"https://api.github.com/users/ContinuityControl/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuityControl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuityControl/subscriptions","organizations_url":"https://api.github.com/users/ContinuityControl/orgs","repos_url":"https://api.github.com/users/ContinuityControl/repos","events_url":"https://api.github.com/users/ContinuityControl/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuityControl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ContinuityControl/pdfkit","description":"HTML+CSS to PDF using wkhtmltopdf","fork":true,"url":"https://api.github.com/repos/ContinuityControl/pdfkit","forks_url":"https://api.github.com/repos/ContinuityControl/pdfkit/forks","keys_url":"https://api.github.com/repos/ContinuityControl/pdfkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ContinuityControl/pdfkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ContinuityControl/pdfkit/teams","hooks_url":"https://api.github.com/repos/ContinuityControl/pdfkit/hooks","issue_events_url":"https://api.github.com/repos/ContinuityControl/pdfkit/issues/events{/number}","events_url":"https://api.github.com/repos/ContinuityControl/pdfkit/events","assignees_url":"https://api.github.com/repos/ContinuityControl/pdfkit/assignees{/user}","branches_url":"https://api.github.com/repos/ContinuityControl/pdfkit/branches{/branch}","tags_url":"https://api.github.com/repos/ContinuityControl/pdfkit/tags","blobs_url":"https://api.github.com/repos/ContinuityControl/pdfkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ContinuityControl/pdfkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ContinuityControl/pdfkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/ContinuityControl/pdfkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ContinuityControl/pdfkit/statuses/{sha}","languages_url":"https://api.github.com/repos/ContinuityControl/pdfkit/languages","stargazers_url":"https://api.github.com/repos/ContinuityControl/pdfkit/stargazers","contributors_url":"https://api.github.com/repos/ContinuityControl/pdfkit/contributors","subscribers_url":"https://api.github.com/repos/ContinuityControl/pdfkit/subscribers","subscription_url":"https://api.github.com/repos/ContinuityControl/pdfkit/subscription","commits_url":"https://api.github.com/repos/ContinuityControl/pdfkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/ContinuityControl/pdfkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/ContinuityControl/pdfkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/ContinuityControl/pdfkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/ContinuityControl/pdfkit/contents/{+path}","compare_url":"https://api.github.com/repos/ContinuityControl/pdfkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ContinuityControl/pdfkit/merges","archive_url":"https://api.github.com/repos/ContinuityControl/pdfkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ContinuityControl/pdfkit/downloads","issues_url":"https://api.github.com/repos/ContinuityControl/pdfkit/issues{/number}","pulls_url":"https://api.github.com/repos/ContinuityControl/pdfkit/pulls{/number}","milestones_url":"https://api.github.com/repos/ContinuityControl/pdfkit/milestones{/number}","notifications_url":"https://api.github.com/repos/ContinuityControl/pdfkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ContinuityControl/pdfkit/labels{/name}","releases_url":"https://api.github.com/repos/ContinuityControl/pdfkit/releases{/id}","created_at":"2011-06-07T14:45:41Z","updated_at":"2015-03-05T19:53:23Z","pushed_at":"2016-01-08T16:00:23Z","git_url":"git://github.com/ContinuityControl/pdfkit.git","ssh_url":"git@github.com:ContinuityControl/pdfkit.git","clone_url":"https://github.com/ContinuityControl/pdfkit.git","svn_url":"https://github.com/ContinuityControl/pdfkit","homepage":null,"size":16406,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"pdfkit:master","ref":"master","sha":"ad202a0944208bf09011fec95437e042c38ad0c5","user":{"login":"pdfkit","id":1521782,"avatar_url":"https://avatars.githubusercontent.com/u/1521782?v=3","gravatar_id":"","url":"https://api.github.com/users/pdfkit","html_url":"https://github.com/pdfkit","followers_url":"https://api.github.com/users/pdfkit/followers","following_url":"https://api.github.com/users/pdfkit/following{/other_user}","gists_url":"https://api.github.com/users/pdfkit/gists{/gist_id}","starred_url":"https://api.github.com/users/pdfkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdfkit/subscriptions","organizations_url":"https://api.github.com/users/pdfkit/orgs","repos_url":"https://api.github.com/users/pdfkit/repos","events_url":"https://api.github.com/users/pdfkit/events{/privacy}","received_events_url":"https://api.github.com/users/pdfkit/received_events","type":"Organization","site_admin":false},"repo":{"id":678938,"name":"pdfkit","full_name":"pdfkit/pdfkit","owner":{"login":"pdfkit","id":1521782,"avatar_url":"https://avatars.githubusercontent.com/u/1521782?v=3","gravatar_id":"","url":"https://api.github.com/users/pdfkit","html_url":"https://github.com/pdfkit","followers_url":"https://api.github.com/users/pdfkit/followers","following_url":"https://api.github.com/users/pdfkit/following{/other_user}","gists_url":"https://api.github.com/users/pdfkit/gists{/gist_id}","starred_url":"https://api.github.com/users/pdfkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdfkit/subscriptions","organizations_url":"https://api.github.com/users/pdfkit/orgs","repos_url":"https://api.github.com/users/pdfkit/repos","events_url":"https://api.github.com/users/pdfkit/events{/privacy}","received_events_url":"https://api.github.com/users/pdfkit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pdfkit/pdfkit","description":"A Ruby gem to transform HTML + CSS into PDFs using the command-line utility wkhtmltopdf","fork":false,"url":"https://api.github.com/repos/pdfkit/pdfkit","forks_url":"https://api.github.com/repos/pdfkit/pdfkit/forks","keys_url":"https://api.github.com/repos/pdfkit/pdfkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pdfkit/pdfkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pdfkit/pdfkit/teams","hooks_url":"https://api.github.com/repos/pdfkit/pdfkit/hooks","issue_events_url":"https://api.github.com/repos/pdfkit/pdfkit/issues/events{/number}","events_url":"https://api.github.com/repos/pdfkit/pdfkit/events","assignees_url":"https://api.github.com/repos/pdfkit/pdfkit/assignees{/user}","branches_url":"https://api.github.com/repos/pdfkit/pdfkit/branches{/branch}","tags_url":"https://api.github.com/repos/pdfkit/pdfkit/tags","blobs_url":"https://api.github.com/repos/pdfkit/pdfkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pdfkit/pdfkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pdfkit/pdfkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/pdfkit/pdfkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pdfkit/pdfkit/statuses/{sha}","languages_url":"https://api.github.com/repos/pdfkit/pdfkit/languages","stargazers_url":"https://api.github.com/repos/pdfkit/pdfkit/stargazers","contributors_url":"https://api.github.com/repos/pdfkit/pdfkit/contributors","subscribers_url":"https://api.github.com/repos/pdfkit/pdfkit/subscribers","subscription_url":"https://api.github.com/repos/pdfkit/pdfkit/subscription","commits_url":"https://api.github.com/repos/pdfkit/pdfkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/pdfkit/pdfkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/pdfkit/pdfkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/pdfkit/pdfkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/pdfkit/pdfkit/contents/{+path}","compare_url":"https://api.github.com/repos/pdfkit/pdfkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pdfkit/pdfkit/merges","archive_url":"https://api.github.com/repos/pdfkit/pdfkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pdfkit/pdfkit/downloads","issues_url":"https://api.github.com/repos/pdfkit/pdfkit/issues{/number}","pulls_url":"https://api.github.com/repos/pdfkit/pdfkit/pulls{/number}","milestones_url":"https://api.github.com/repos/pdfkit/pdfkit/milestones{/number}","notifications_url":"https://api.github.com/repos/pdfkit/pdfkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pdfkit/pdfkit/labels{/name}","releases_url":"https://api.github.com/repos/pdfkit/pdfkit/releases{/id}","created_at":"2010-05-21T13:21:26Z","updated_at":"2016-01-06T07:03:09Z","pushed_at":"2016-01-08T16:00:24Z","git_url":"git://github.com/pdfkit/pdfkit.git","ssh_url":"git@github.com:pdfkit/pdfkit.git","clone_url":"https://github.com/pdfkit/pdfkit.git","svn_url":"https://github.com/pdfkit/pdfkit","homepage":"","size":16774,"stargazers_count":2088,"watchers_count":2088,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":287,"mirror_url":null,"open_issues_count":18,"forks":287,"open_issues":18,"watchers":2088,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344"},"html":{"href":"https://github.com/pdfkit/pdfkit/pull/344"},"issue":{"href":"https://api.github.com/repos/pdfkit/pdfkit/issues/344"},"comments":{"href":"https://api.github.com/repos/pdfkit/pdfkit/issues/344/comments"},"review_comments":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344/comments"},"review_comment":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pdfkit/pdfkit/pulls/344/commits"},"statuses":{"href":"https://api.github.com/repos/pdfkit/pdfkit/statuses/5733acbfcf9503ee68dc3ebc1f8550cebed85282"}}}}