diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-12-02 02:09:07 -0800 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-12-02 02:09:07 -0800 |
| commit | 9cfdd4cb030cb576cd997fe81799d9498f8ff117 (patch) | |
| tree | 1a4b2cc78d391be3f8714f669a3eeb8c2b57c436 | |
| parent | f2fcef346272330429c00946e017e129b0b87add (diff) | |
| parent | 8d3301a23f54fa6ee062dea251639d3c4fa92cb8 (diff) | |
Merge pull request #833 from mojavelinux/issue-819
resolves #819 match URL macro following entity
| -rwxr-xr-x | lib/asciidoctor.rb | 2 | ||||
| -rw-r--r-- | test/links_test.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb index 073e3760..d2046372 100755 --- a/lib/asciidoctor.rb +++ b/lib/asciidoctor.rb @@ -557,7 +557,7 @@ module Asciidoctor # inline link and some inline link macro # FIXME revisit! - :link_inline => %r{(^|link:|\s|>|<|[\(\)\[\]])(\\?(?:https?|ftp|irc)://[^\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 39f08024..4a47aef9 100644 --- a/test/links_test.rb +++ b/test/links_test.rb @@ -50,6 +50,11 @@ context 'Links' do assert_xpath '//a[@href="http://asciidoc.org"][text()="AsciiDoc"]', render_string(')http://asciidoc.org[AsciiDoc] project page.'), 1 end + test 'qualified url following smart apostrophe' do + output = render_embedded_string("l’http://www.irit.fr[IRIT]") + assert_match(/l’<a href=/, output) + end + test 'qualified url using invalid link macro should not create link' do assert_xpath '//a', render_string('link:http://asciidoc.org is the project page for AsciiDoc.'), 0 end |
