{"action":"created","comment":{"url":"https://api.github.com/repos/karnov/htmltoword/pulls/comments/39687000","id":39687000,"diff_hunk":"@@ -0,0 +1,35 @@\n+<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n+                xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"\n+                xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"\n+                xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n+                xmlns:v=\"urn:schemas-microsoft-com:vml\"\n+                xmlns:WX=\"http://schemas.microsoft.com/office/word/2003/auxHint\"\n+                xmlns:aml=\"http://schemas.microsoft.com/aml/2001/core\"\n+                xmlns:w10=\"urn:schemas-microsoft-com:office:word\"\n+                xmlns:pkg=\"http://schemas.microsoft.com/office/2006/xmlPackage\"\n+                xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\"\n+                xmlns:ext=\"http://www.xmllab.net/wordml2html/ext\"\n+                xmlns:java=\"http://xml.apache.org/xalan/java\"\n+                xmlns:str=\"http://exslt.org/strings\"\n+                xmlns:func=\"http://exslt.org/functions\"\n+                xmlns:fn=\"http://www.w3.org/2005/xpath-functions\"\n+                version=\"1.0\"\n+                exclude-result-prefixes=\"java msxsl ext w o v WX aml w10\"\n+                extension-element-prefixes=\"func\">\n+\n+  <xsl:template match=\"a[starts-with(@href, 'http://') or starts-with(@href, 'https://')]\" name=\"link\">","path":"lib/htmltoword/xslt/links.xslt","position":20,"original_position":20,"commit_id":"2d24ad742a67b57edf07165f5eba38a862c98729","original_commit_id":"2d24ad742a67b57edf07165f5eba38a862c98729","user":{"login":"anitsirc","id":169639,"avatar_url":"https://avatars.githubusercontent.com/u/169639?v=3","gravatar_id":"","url":"https://api.github.com/users/anitsirc","html_url":"https://github.com/anitsirc","followers_url":"https://api.github.com/users/anitsirc/followers","following_url":"https://api.github.com/users/anitsirc/following{/other_user}","gists_url":"https://api.github.com/users/anitsirc/gists{/gist_id}","starred_url":"https://api.github.com/users/anitsirc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anitsirc/subscriptions","organizations_url":"https://api.github.com/users/anitsirc/orgs","repos_url":"https://api.github.com/users/anitsirc/repos","events_url":"https://api.github.com/users/anitsirc/events{/privacy}","received_events_url":"https://api.github.com/users/anitsirc/received_events","type":"User","site_admin":false},"body":"I think it's fine to just make external links work as links (at least for now)\r\n\r\nProblem is that documents get corrupted and doesn't open with current implementation when the html contains relative or local links :confused: \r\n\r\nThe suggestion I made just avoids adding all the hyperlink information if its a local link, so it doesn't try to find a non-existing relation when opening the file.\r\nWhen calling the template it executes it, regardless of the  match condition. The matching rule on the named template applies in cases where it is not already being handled by [this rule](https://github.com/karnov/htmltoword/pull/30/files#diff-a68c01034fe198e4ad04d6a629cc6ab6R134). If that makes any sense :) ","created_at":"2015-09-16T21:22:57Z","updated_at":"2015-09-16T21:22:57Z","html_url":"https://github.com/karnov/htmltoword/pull/30#discussion_r39687000","pull_request_url":"https://api.github.com/repos/karnov/htmltoword/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/comments/39687000"},"html":{"href":"https://github.com/karnov/htmltoword/pull/30#discussion_r39687000"},"pull_request":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/karnov/htmltoword/pulls/30","id":44524059,"html_url":"https://github.com/karnov/htmltoword/pull/30","diff_url":"https://github.com/karnov/htmltoword/pull/30.diff","patch_url":"https://github.com/karnov/htmltoword/pull/30.patch","issue_url":"https://api.github.com/repos/karnov/htmltoword/issues/30","number":30,"state":"open","locked":false,"title":"Handle external links inside html","user":{"login":"cris","id":3313,"avatar_url":"https://avatars.githubusercontent.com/u/3313?v=3","gravatar_id":"","url":"https://api.github.com/users/cris","html_url":"https://github.com/cris","followers_url":"https://api.github.com/users/cris/followers","following_url":"https://api.github.com/users/cris/following{/other_user}","gists_url":"https://api.github.com/users/cris/gists{/gist_id}","starred_url":"https://api.github.com/users/cris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cris/subscriptions","organizations_url":"https://api.github.com/users/cris/orgs","repos_url":"https://api.github.com/users/cris/repos","events_url":"https://api.github.com/users/cris/events{/privacy}","received_events_url":"https://api.github.com/users/cris/received_events","type":"User","site_admin":false},"body":"### Changes\r\n* Added support for handling external links(tag \"a\" with href: http:// and https://)\r\n* In order to support canonical hyperlink tag, puts new links into `relations.xml` according to: http://officeopenxml.com/WPhyperlink.php","created_at":"2015-09-09T08:47:07Z","updated_at":"2015-09-16T21:22:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54e52bbbe8f84074aadaaa7cb864c938212207d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/karnov/htmltoword/pulls/30/commits","review_comments_url":"https://api.github.com/repos/karnov/htmltoword/pulls/30/comments","review_comment_url":"https://api.github.com/repos/karnov/htmltoword/pulls/comments{/number}","comments_url":"https://api.github.com/repos/karnov/htmltoword/issues/30/comments","statuses_url":"https://api.github.com/repos/karnov/htmltoword/statuses/2d24ad742a67b57edf07165f5eba38a862c98729","head":{"label":"brightbytes:feature/links-support","ref":"feature/links-support","sha":"2d24ad742a67b57edf07165f5eba38a862c98729","user":{"login":"brightbytes","id":1341944,"avatar_url":"https://avatars.githubusercontent.com/u/1341944?v=3","gravatar_id":"","url":"https://api.github.com/users/brightbytes","html_url":"https://github.com/brightbytes","followers_url":"https://api.github.com/users/brightbytes/followers","following_url":"https://api.github.com/users/brightbytes/following{/other_user}","gists_url":"https://api.github.com/users/brightbytes/gists{/gist_id}","starred_url":"https://api.github.com/users/brightbytes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brightbytes/subscriptions","organizations_url":"https://api.github.com/users/brightbytes/orgs","repos_url":"https://api.github.com/users/brightbytes/repos","events_url":"https://api.github.com/users/brightbytes/events{/privacy}","received_events_url":"https://api.github.com/users/brightbytes/received_events","type":"Organization","site_admin":false},"repo":{"id":42127927,"name":"htmltoword","full_name":"brightbytes/htmltoword","owner":{"login":"brightbytes","id":1341944,"avatar_url":"https://avatars.githubusercontent.com/u/1341944?v=3","gravatar_id":"","url":"https://api.github.com/users/brightbytes","html_url":"https://github.com/brightbytes","followers_url":"https://api.github.com/users/brightbytes/followers","following_url":"https://api.github.com/users/brightbytes/following{/other_user}","gists_url":"https://api.github.com/users/brightbytes/gists{/gist_id}","starred_url":"https://api.github.com/users/brightbytes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brightbytes/subscriptions","organizations_url":"https://api.github.com/users/brightbytes/orgs","repos_url":"https://api.github.com/users/brightbytes/repos","events_url":"https://api.github.com/users/brightbytes/events{/privacy}","received_events_url":"https://api.github.com/users/brightbytes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brightbytes/htmltoword","description":"Ruby html to word gem","fork":true,"url":"https://api.github.com/repos/brightbytes/htmltoword","forks_url":"https://api.github.com/repos/brightbytes/htmltoword/forks","keys_url":"https://api.github.com/repos/brightbytes/htmltoword/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brightbytes/htmltoword/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brightbytes/htmltoword/teams","hooks_url":"https://api.github.com/repos/brightbytes/htmltoword/hooks","issue_events_url":"https://api.github.com/repos/brightbytes/htmltoword/issues/events{/number}","events_url":"https://api.github.com/repos/brightbytes/htmltoword/events","assignees_url":"https://api.github.com/repos/brightbytes/htmltoword/assignees{/user}","branches_url":"https://api.github.com/repos/brightbytes/htmltoword/branches{/branch}","tags_url":"https://api.github.com/repos/brightbytes/htmltoword/tags","blobs_url":"https://api.github.com/repos/brightbytes/htmltoword/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brightbytes/htmltoword/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brightbytes/htmltoword/git/refs{/sha}","trees_url":"https://api.github.com/repos/brightbytes/htmltoword/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brightbytes/htmltoword/statuses/{sha}","languages_url":"https://api.github.com/repos/brightbytes/htmltoword/languages","stargazers_url":"https://api.github.com/repos/brightbytes/htmltoword/stargazers","contributors_url":"https://api.github.com/repos/brightbytes/htmltoword/contributors","subscribers_url":"https://api.github.com/repos/brightbytes/htmltoword/subscribers","subscription_url":"https://api.github.com/repos/brightbytes/htmltoword/subscription","commits_url":"https://api.github.com/repos/brightbytes/htmltoword/commits{/sha}","git_commits_url":"https://api.github.com/repos/brightbytes/htmltoword/git/commits{/sha}","comments_url":"https://api.github.com/repos/brightbytes/htmltoword/comments{/number}","issue_comment_url":"https://api.github.com/repos/brightbytes/htmltoword/issues/comments{/number}","contents_url":"https://api.github.com/repos/brightbytes/htmltoword/contents/{+path}","compare_url":"https://api.github.com/repos/brightbytes/htmltoword/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brightbytes/htmltoword/merges","archive_url":"https://api.github.com/repos/brightbytes/htmltoword/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brightbytes/htmltoword/downloads","issues_url":"https://api.github.com/repos/brightbytes/htmltoword/issues{/number}","pulls_url":"https://api.github.com/repos/brightbytes/htmltoword/pulls{/number}","milestones_url":"https://api.github.com/repos/brightbytes/htmltoword/milestones{/number}","notifications_url":"https://api.github.com/repos/brightbytes/htmltoword/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brightbytes/htmltoword/labels{/name}","releases_url":"https://api.github.com/repos/brightbytes/htmltoword/releases{/id}","created_at":"2015-09-08T17:27:33Z","updated_at":"2015-09-08T17:27:33Z","pushed_at":"2015-09-09T08:36:25Z","git_url":"git://github.com/brightbytes/htmltoword.git","ssh_url":"git@github.com:brightbytes/htmltoword.git","clone_url":"https://github.com/brightbytes/htmltoword.git","svn_url":"https://github.com/brightbytes/htmltoword","homepage":null,"size":487,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"karnov:master","ref":"master","sha":"3dcb6f699f7768fdf94a3d69c5d9721a9f8cad59","user":{"login":"karnov","id":834717,"avatar_url":"https://avatars.githubusercontent.com/u/834717?v=3","gravatar_id":"","url":"https://api.github.com/users/karnov","html_url":"https://github.com/karnov","followers_url":"https://api.github.com/users/karnov/followers","following_url":"https://api.github.com/users/karnov/following{/other_user}","gists_url":"https://api.github.com/users/karnov/gists{/gist_id}","starred_url":"https://api.github.com/users/karnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karnov/subscriptions","organizations_url":"https://api.github.com/users/karnov/orgs","repos_url":"https://api.github.com/users/karnov/repos","events_url":"https://api.github.com/users/karnov/events{/privacy}","received_events_url":"https://api.github.com/users/karnov/received_events","type":"Organization","site_admin":false},"repo":{"id":12727748,"name":"htmltoword","full_name":"karnov/htmltoword","owner":{"login":"karnov","id":834717,"avatar_url":"https://avatars.githubusercontent.com/u/834717?v=3","gravatar_id":"","url":"https://api.github.com/users/karnov","html_url":"https://github.com/karnov","followers_url":"https://api.github.com/users/karnov/followers","following_url":"https://api.github.com/users/karnov/following{/other_user}","gists_url":"https://api.github.com/users/karnov/gists{/gist_id}","starred_url":"https://api.github.com/users/karnov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karnov/subscriptions","organizations_url":"https://api.github.com/users/karnov/orgs","repos_url":"https://api.github.com/users/karnov/repos","events_url":"https://api.github.com/users/karnov/events{/privacy}","received_events_url":"https://api.github.com/users/karnov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/karnov/htmltoword","description":"Ruby html to word gem","fork":true,"url":"https://api.github.com/repos/karnov/htmltoword","forks_url":"https://api.github.com/repos/karnov/htmltoword/forks","keys_url":"https://api.github.com/repos/karnov/htmltoword/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karnov/htmltoword/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karnov/htmltoword/teams","hooks_url":"https://api.github.com/repos/karnov/htmltoword/hooks","issue_events_url":"https://api.github.com/repos/karnov/htmltoword/issues/events{/number}","events_url":"https://api.github.com/repos/karnov/htmltoword/events","assignees_url":"https://api.github.com/repos/karnov/htmltoword/assignees{/user}","branches_url":"https://api.github.com/repos/karnov/htmltoword/branches{/branch}","tags_url":"https://api.github.com/repos/karnov/htmltoword/tags","blobs_url":"https://api.github.com/repos/karnov/htmltoword/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karnov/htmltoword/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karnov/htmltoword/git/refs{/sha}","trees_url":"https://api.github.com/repos/karnov/htmltoword/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karnov/htmltoword/statuses/{sha}","languages_url":"https://api.github.com/repos/karnov/htmltoword/languages","stargazers_url":"https://api.github.com/repos/karnov/htmltoword/stargazers","contributors_url":"https://api.github.com/repos/karnov/htmltoword/contributors","subscribers_url":"https://api.github.com/repos/karnov/htmltoword/subscribers","subscription_url":"https://api.github.com/repos/karnov/htmltoword/subscription","commits_url":"https://api.github.com/repos/karnov/htmltoword/commits{/sha}","git_commits_url":"https://api.github.com/repos/karnov/htmltoword/git/commits{/sha}","comments_url":"https://api.github.com/repos/karnov/htmltoword/comments{/number}","issue_comment_url":"https://api.github.com/repos/karnov/htmltoword/issues/comments{/number}","contents_url":"https://api.github.com/repos/karnov/htmltoword/contents/{+path}","compare_url":"https://api.github.com/repos/karnov/htmltoword/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karnov/htmltoword/merges","archive_url":"https://api.github.com/repos/karnov/htmltoword/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karnov/htmltoword/downloads","issues_url":"https://api.github.com/repos/karnov/htmltoword/issues{/number}","pulls_url":"https://api.github.com/repos/karnov/htmltoword/pulls{/number}","milestones_url":"https://api.github.com/repos/karnov/htmltoword/milestones{/number}","notifications_url":"https://api.github.com/repos/karnov/htmltoword/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karnov/htmltoword/labels{/name}","releases_url":"https://api.github.com/repos/karnov/htmltoword/releases{/id}","created_at":"2013-09-10T11:21:36Z","updated_at":"2015-09-09T18:29:22Z","pushed_at":"2015-09-16T15:21:35Z","git_url":"git://github.com/karnov/htmltoword.git","ssh_url":"git@github.com:karnov/htmltoword.git","clone_url":"https://github.com/karnov/htmltoword.git","svn_url":"https://github.com/karnov/htmltoword","homepage":null,"size":657,"stargazers_count":21,"watchers_count":21,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":13,"forks":6,"open_issues":13,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/30"},"html":{"href":"https://github.com/karnov/htmltoword/pull/30"},"issue":{"href":"https://api.github.com/repos/karnov/htmltoword/issues/30"},"comments":{"href":"https://api.github.com/repos/karnov/htmltoword/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/karnov/htmltoword/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/karnov/htmltoword/statuses/2d24ad742a67b57edf07165f5eba38a862c98729"}}}}