
sub html_ify
{
 my ($data,$field) = @_;
 my ($option,%html_opts);
 
 if (!$html_fields{$field}){ $html_fields{$field} = ''; }
 
 # Fix "http://" prefix for hyperlinks:
 if ($html_fields{$field} eq 'link' && $data !~ /^http(s*)\:\/\//){ $data = 'http://'.$data; }
 
 
 	# Define each 'htmlify' option and the associated HTML:
 	# 	(Format: option_name => "HTML FORMATTING HERE")
 
 %html_opts = (	
 	underline	=> "<u>$data</u>", italic	=> "<i>$data</i>", 
 	bold		=> "<b>$data</b>", link		=> "<a class='link' href='$data' target='_new'>$data</a>",
 	mailto		=> "<a class='link' href='mailto:$data'>$data</a>");
 
 
 	# If this field is in the list to 'htmlify':
 
 	# 1. Get the html option to use (e.g. bold, italic, etc).
 	# 2. Apply the HTML formatting for the appropriate option.
 
 if ($html_fields{$field}){
  $option = $html_fields{$field};
  $data	= $html_opts{$option};
 }
 
 return $data;
}

1;