*** lib/maruku/output/to_html.rb.bak	2008-03-21 00:39:37.000000000 +0200
--- lib/maruku/output/to_html.rb	2008-03-21 00:40:25.000000000 +0200
***************
*** 721,745 ****
  	end
  ##### Email address
  	
! 	def obfuscate(s)
  		res = ''
  		s.each_byte do |char|
! 			res +=  "&#%03d;" % char
  		end
  		res
  	end
  	
  	def to_html_email_address
! 		email = self.email
! 		a = create_html_element 'a'
! 			#a.attributes['href'] = Text.new("mailto:"+obfuscate(email),false,nil,true)
! 			#a.attributes.add Attribute.new('href',Text.new(
! 			#"mailto:"+obfuscate(email),false,nil,true))
! 			# Sorry, for the moment it doesn't work
! 			a.attributes['href'] = "mailto:#{email}"
! 			
! 			a << Text.new(obfuscate(email),false,nil,true)
! 		a
  	end
  
  ##### Images
--- 722,751 ----
  	end
  ##### Email address
  	
!     # We're replacing character with their codes.
!     # url_style specifies whether this email goes into the link (and so can use %xx style encoding),
!     # or it will be used as the text to display
! 	def obfuscate(s, url_style = false)
  		res = ''
  		s.each_byte do |char|
!             res += if (url_style) then
!                 case rand(3)
!                     when 0: "&#%03d;" % char
!                     when 1: "%%%02x" % char
!                     when 2: char.chr
!                 end
!             else
!                 case rand(2)
!                     when 0: "&#%03d;" % char
!                     when 1: char.chr
!                 end
!             end
  		end
  		res
  	end
  	
  	def to_html_email_address
!         Text.new("<a href='mailto:#{obfuscate(self.email, true)}'>#{obfuscate(self.email)}</a>",false,nil,true,nil,nil)
  	end
  
  ##### Images
