{"action":"opened","issue":{"url":"https://api.github.com/repos/jhannah/pdf-textblock/issues/2","labels_url":"https://api.github.com/repos/jhannah/pdf-textblock/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jhannah/pdf-textblock/issues/2/comments","events_url":"https://api.github.com/repos/jhannah/pdf-textblock/issues/2/events","html_url":"https://github.com/jhannah/pdf-textblock/issues/2","id":103681010,"number":2,"title":"Different styles for href tag","user":{"login":"fabiomux","id":7922041,"avatar_url":"https://avatars.githubusercontent.com/u/7922041?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiomux","html_url":"https://github.com/fabiomux","followers_url":"https://api.github.com/users/fabiomux/followers","following_url":"https://api.github.com/users/fabiomux/following{/other_user}","gists_url":"https://api.github.com/users/fabiomux/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiomux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiomux/subscriptions","organizations_url":"https://api.github.com/users/fabiomux/orgs","repos_url":"https://api.github.com/users/fabiomux/repos","events_url":"https://api.github.com/users/fabiomux/events{/privacy}","received_events_url":"https://api.github.com/users/fabiomux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-28T09:15:37Z","updated_at":"2015-08-28T09:15:37Z","closed_at":null,"body":"Hi there,\r\n\r\nin the need to have a different style for different href tags, i added some small changes to your code, wondering if you might include something like that in the next release.\r\n\r\nBelow the content of my patch:\r\n\r\n```\r\n--- a/lib/PDF/TextBlock.pm\r\n+++ b/lib/PDF/TextBlock.pm\r\n@@ -401,10 +401,9 @@ sub apply {\r\n          foreach my $word (@line) {\r\n             if (($tag) = ($word =~ /<(.*?)>/)) {\r\n                # warn \"tag is $tag\";\r\n-               if ($tag =~ /^href/) {\r\n-                  ($href) = ($tag =~ /href=\"(.*?)\"/);\r\n-                  # warn \"href is now $href\";\r\n-                  $current_content_text = $content_texts{href} if ref $content_texts{href};\r\n+               if ($tag =~ /^href[a-z]?/) {\r\n+                  ($tag, $href) = ($tag =~ /(href[a-z]?)=\"(.*?)\"/);\r\n+                  $current_content_text = $content_texts{$tag} if ref $content_texts{$tag};\r\n                } elsif ($tag !~ /\\//) {\r\n                   $current_content_text = $content_texts{$tag};\r\n                }\r\n@@ -425,7 +424,7 @@ sub apply {\r\n                # $underline->strokecolor('black');\r\n                $underline->linewidth(.5);\r\n                $underline->move( $xpos, $ypos - 2);\r\n-               if ($word =~ /<\\/href/) {\r\n+               if ($word =~ /<\\/href[a-z]?/) {\r\n                   $underline->line( $xpos + $width{$word}, $ypos - 2);\r\n                } else {\r\n                   $underline->line( $xpos + $width{$word} + $wordspace, $ypos - 2);\r\n@@ -447,7 +446,7 @@ sub apply {\r\n             $xpos += ( $width{$word} + $wordspace ) if (@line);\r\n \r\n             if ($word =~ /\\//) {\r\n-               if ($word =~ /\\/href/) {\r\n+               if ($word =~ /\\/href[a-z]?/) {\r\n                   undef $href;\r\n                }\r\n                unless ($href) {\r\n                  \r\n```\r\n"}}