diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-05-27 23:47:53 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-05-27 23:47:53 -0700 |
| commit | 6f25334098b5c27435b639ba818464f337344210 (patch) | |
| tree | a598f729c63b1f446715bc8210aafc75045a8606 | |
| parent | 37d6fb568058a16b1098da3c9e4316342380823b (diff) | |
| parent | 4837ce2333089979b96a0a5aaaa19881c45f1e38 (diff) | |
Merge pull request #361 from mojavelinux/irc-url-scheme
resolves #314 add irc scheme to link detection
| -rwxr-xr-x | lib/asciidoctor.rb | 2 | ||||
| -rw-r--r-- | test/links_test.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb index 059b2ac0..17b22448 100755 --- a/lib/asciidoctor.rb +++ b/lib/asciidoctor.rb @@ -375,7 +375,7 @@ module Asciidoctor # inline link and some inline link macro # FIXME revisit! - :link_inline => %r{(^|link:|\s|>|<|[\(\)\[\]])(\\?(?:https?|ftp)://[^\s\[<]*[^\s.,\[<])(?:\[((?:\\\]|[^\]])*?)\])?}, + :link_inline => %r{(^|link:|\s|>|<|[\(\)\[\]])(\\?(?:https?|ftp|irc)://[^\s\[<]*[^\s.,\[<])(?:\[((?:\\\]|[^\]])*?)\])?}, # inline link macro # link:path[label] diff --git a/test/links_test.rb b/test/links_test.rb index 94e82756..67a62204 100644 --- a/test/links_test.rb +++ b/test/links_test.rb @@ -86,6 +86,14 @@ context 'Links' do assert_xpath '//a[@href="http://google.com"][@target="_blank"]', render_embedded_string('http://google.com[Google^]'), 1 end + test 'inline irc link' do + assert_xpath '//a[@href="irc://irc.freenode.net"][text()="irc://irc.freenode.net"]', render_embedded_string('irc://irc.freenode.net'), 1 + end + + test 'inline irc link with text' do + assert_xpath '//a[@href="irc://irc.freenode.net"][text()="Freenode IRC"]', render_embedded_string('irc://irc.freenode.net[Freenode IRC]'), 1 + end + test 'inline ref' do doc = document_from_string 'Here you can read about tigers.[[tigers]]' output = doc.render |
