<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -370,8 +370,8 @@ module ActionView
         options.reverse_merge!(:link =&gt; :all, :html =&gt; {})
 
         case options[:link].to_sym
-          when :all                         then auto_link_email_addresses(auto_link_urls(text, options[:html], &amp;block), &amp;block)
-          when :email_addresses             then auto_link_email_addresses(text, &amp;block)
+          when :all                         then auto_link_email_addresses(auto_link_urls(text, options[:html], &amp;block), options[:html], &amp;block)
+          when :email_addresses             then auto_link_email_addresses(text, options[:html], &amp;block)
           when :urls                        then auto_link_urls(text, options[:html], &amp;block)
         end
       end
@@ -559,7 +559,7 @@ module ActionView
 
         # Turns all email addresses into clickable links.  If a block is given,
         # each email is yielded and the result is used as the link text.
-        def auto_link_email_addresses(text)
+        def auto_link_email_addresses(text, html_options = {})
           body = text.dup
           text.gsub(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do
             text = $1
@@ -568,7 +568,7 @@ module ActionView
               text
             else
               display_text = (block_given?) ? yield(text) : text
-              %{&lt;a href=&quot;mailto:#{text}&quot;&gt;#{display_text}&lt;/a&gt;}
+              mail_to text, display_text, html_options
             end
           end
         end</diff>
      <filename>actionpack/lib/action_view/helpers/text_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -262,6 +262,11 @@ class TextHelperTest &lt; ActionView::TestCase
     email2_result = %{&lt;a href=&quot;mailto:#{email2_raw}&quot;&gt;#{email2_raw}&lt;/a&gt;}
     assert_equal email2_result, auto_link(email2_raw)
 
+    email3_raw    = '+david@loudthinking.com'
+    email3_result = %{&lt;a href=&quot;&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;+%64%61%76%69%64@%6c%6f%75%64%74%68%69%6e%6b%69%6e%67.%63%6f%6d&quot;&gt;#{email3_raw}&lt;/a&gt;}
+    assert_equal email3_result, auto_link(email3_raw, :all, :encode =&gt; :hex)
+    assert_equal email3_result, auto_link(email3_raw, :email_addresses, :encode =&gt; :hex)
+
     link2_raw    = 'www.rubyonrails.com'
     link2_result = generate_result(link2_raw, &quot;http://#{link2_raw}&quot;)
     assert_equal %(Go to #{link2_result}), auto_link(&quot;Go to #{link2_raw}&quot;, :urls)
@@ -362,7 +367,7 @@ class TextHelperTest &lt; ActionView::TestCase
   end
 
   def test_auto_link_with_options_hash
-    assert_dom_equal 'Welcome to my new blog at &lt;a href=&quot;http://www.myblog.com/&quot; class=&quot;menu&quot; target=&quot;_blank&quot;&gt;http://www.myblog.com/&lt;/a&gt;. Please e-mail me at &lt;a href=&quot;mailto:me@email.com&quot;&gt;me@email.com&lt;/a&gt;.',
+    assert_dom_equal 'Welcome to my new blog at &lt;a href=&quot;http://www.myblog.com/&quot; class=&quot;menu&quot; target=&quot;_blank&quot;&gt;http://www.myblog.com/&lt;/a&gt;. Please e-mail me at &lt;a href=&quot;mailto:me@email.com&quot; class=&quot;menu&quot; target=&quot;_blank&quot;&gt;me@email.com&lt;/a&gt;.',
       auto_link(&quot;Welcome to my new blog at http://www.myblog.com/. Please e-mail me at me@email.com.&quot;,
                 :link =&gt; :all, :html =&gt; { :class =&gt; &quot;menu&quot;, :target =&gt; &quot;_blank&quot; })
   end</diff>
      <filename>actionpack/test/template/text_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>25f6524b89900378d08de9ec45757813dbb650cf</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Kaspick</name>
    <login>akaspick</login>
    <email>andrew@redlinesoftware.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/bda55f82c687920807f606a2b024f1882094ef1e</url>
  <id>bda55f82c687920807f606a2b024f1882094ef1e</id>
  <committed-date>2008-12-01T10:27:03-08:00</committed-date>
  <authored-date>2008-11-19T10:55:27-08:00</authored-date>
  <message>allow options to be passed to email address auto generation

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;

[#1418 state:committed]</message>
  <tree>953bce745ee12b86bf471814ff7adf54548da393</tree>
  <committer>
    <name>Michael Koziarski</name>
    <login>NZKoz</login>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
