diff options
author | B Mathis <brandon@imathis.com> | 2009-11-12 14:42:31 -0600 |
---|---|---|
committer | B Mathis <brandon@imathis.com> | 2009-11-12 14:42:31 -0600 |
commit | bd96f301ef90953c1d59df9493142fcd5ce37c56 (patch) | |
tree | 2fcfe5cbcc40d74a6a1addf52f644f5dae8bd9e4 | |
parent | 8653d3e936ce67e15e1ed4424591a480d68cd87d (diff) | |
download | my_new_personal_website-bd96f301ef90953c1d59df9493142fcd5ce37c56.tar.xz my_new_personal_website-bd96f301ef90953c1d59df9493142fcd5ce37c56.zip |
added back html_email obfusticator
Diffstat (limited to '')
-rw-r--r-- | source/_helpers.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/_helpers.rb b/source/_helpers.rb index 2eca937c..43377dcd 100644 --- a/source/_helpers.rb +++ b/source/_helpers.rb @@ -113,6 +113,15 @@ module Helpers # My added helpers + def to_html_email(address) + email = string_to_html(address) + "<a href=\"#{string_to_html('mailto:')}#{email}\">#{email}</a>" + end + + def string_to_html(s) + s.strip.unpack("C*").map{|ch| "&#" + ch.to_s + ";" }.to_s + end + def show_part (file) data = '' f = File.open(Dir.pwd+"/source/"+file) |