From 7fec779e66da113347bb65af73a84ea7da75d564 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 2 Mar 2019 03:15:53 -0700 Subject: resolves #2553 allow ampersand in implicit email address (PR #2936) --- CHANGELOG.adoc | 1 + lib/asciidoctor.rb | 2 +- test/substitutions_test.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 502180e6..33481140 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -67,6 +67,7 @@ Enhancements / Compliance:: * allow backend to delegate to a registered backend using the syntax synthetic:delegate when using custom templates (e.g., slides:html) (#891) * AbstractBlock#find_by looks inside AsciiDoc table cells if traverse_documents selector option is true (#3101) * AbstractBlock#find_by finds table cells, which can be selected using the :table_cell context in the selector (#2524) + * allow ampersand to be used in e-mail address (#2553) Improvements:: diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb index aa112999..380309c1 100644 --- a/lib/asciidoctor.rb +++ b/lib/asciidoctor.rb @@ -828,7 +828,7 @@ module Asciidoctor # # doc.writer@example.com # - InlineEmailRx = %r(([\\>:/])?#{CG_WORD}[#{CC_WORD}.%+-]*@#{CG_ALNUM}[#{CC_ALNUM}.-]*\.#{CG_ALPHA}{2,4}\b) + InlineEmailRx = %r(([\\>:/])?#{CG_WORD}(?:&|[#{CC_WORD}.%+-])*@#{CG_ALNUM}[#{CC_ALNUM}.-]*\.#{CG_ALPHA}{2,4}\b) # Matches an inline footnote macro, which is allowed to span multiple lines. # diff --git a/test/substitutions_test.rb b/test/substitutions_test.rb index f63336be..905d3bec 100644 --- a/test/substitutions_test.rb +++ b/test/substitutions_test.rb @@ -626,6 +626,8 @@ context 'Substitutions' do assert_equal %q{author+website@4fs.no}, para.sub_macros(para.source) para = block_from_string('john@domain.uk.co') assert_equal %q{john@domain.uk.co}, para.sub_macros(para.source) + para = block_from_string('bert&ernie@sesamestreet.com') + assert_equal %q{bert&ernie@sesamestreet.com}, para.apply_subs(para.source) end test 'should ignore escaped inline email address' do -- cgit v1.2.3