Index: trunk/cic-hcap/perllib/plugins/CICPlug.pm
===================================================================
--- trunk/cic-hcap/perllib/plugins/CICPlug.pm	(revision 12858)
+++ trunk/cic-hcap/perllib/plugins/CICPlug.pm	(revision 12859)
@@ -380,5 +380,5 @@
 	    my $institution_place_id = $institution_places_match_hashref->{"Entry_ID"};
 	    my $institution_place_name = $institution_places_match_hashref->{"Current_name"};
-	    $institution_places_list_html .= "<span class=\"cictext\"><a href=\"_gwcgi_?a=d&d=p$institution_place_id\">$institution_place_name</a></span><br />\n";
+	    $institution_places_list_html .= "<span class=\"cictext\"><a href=\"_gwcgi_?a=d&amp;d=p$institution_place_id\">$institution_place_name</a></span><br />\n";
 	}
 	&new_metadata_entry($institution_doc_obj, "InstitutionPlacesListHTML", $institution_places_list_html);
@@ -423,5 +423,5 @@
 	    my $institution_best_place_id = $institution_best_place_image_hashref->{"Entry_ID"};
 	    my $institution_best_place_image_medium_file_href = $self->generate_place_image_variant($institution_doc_obj, $institution_best_place_image_location, "medium");
-	    &new_metadata_entry($institution_doc_obj, "InstitutionBestPlaceImageHTML", "<a href=\"_gwcgi_?a=d&d=p$institution_best_place_id\"><img src=\"$institution_best_place_image_medium_file_href\"/><br /><span class=\"cictext\">$institution_best_place_image_name</span></a>");
+	    &new_metadata_entry($institution_doc_obj, "InstitutionBestPlaceImageHTML", "<a href=\"_gwcgi_?a=d&amp;d=p$institution_best_place_id\"><img src=\"$institution_best_place_image_medium_file_href\"/><br /><span class=\"cictext\">$institution_best_place_image_name</span></a>");
 	}
 
@@ -463,5 +463,5 @@
 		$institution_doc_obj->add_utf8_metadata($institution_campus_plan_image_section, "ImagePath", $institution_campus_plan_image_large_file_href);
 
-		$institution_campus_plans_list_html .= "<a href=\"_gwcgi_?a=d&d=i$institution_id.$institution_campus_plan_image_section\"><span class=\"cictext\">$institution_campus_plan_name</span></a><br />";
+		$institution_campus_plans_list_html .= "<a href=\"_gwcgi_?a=d&amp;d=i$institution_id.$institution_campus_plan_image_section\"><span class=\"cictext\">$institution_campus_plan_name</span></a><br />";
 	    }
 	}
@@ -685,5 +685,5 @@
 		    $designer_name_to_id_mapping{$designer_name} = $designer_id;
 		}
-		$place_construction_architect_links .= "<a href=\"_gwcgi_?a=d&d=d$designer_id\">$designer_name</a> ";
+		$place_construction_architect_links .= "<a href=\"_gwcgi_?a=d&amp;d=d$designer_id\">$designer_name</a> ";
 		push(@{$designer_name_to_place_ids_mapping{$designer_name}}, $place_id);
 	    }
@@ -848,5 +848,5 @@
 		    $place_doc_obj->add_utf8_metadata($place_image_section, "ImagePath", $place_image_large_file_href);
 
-		    $place_images_html .= "<tr><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$place_id.$place_image_section\"><img src=\"$place_image_small_file_href\"/></a></td><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$place_id.$place_image_section\"><span class=\"cictext\">$place_image_name</span></a></td></tr>\n";
+		    $place_images_html .= "<tr><td valign=\"top\"><a href=\"_gwcgi_?a=d&amp;d=p$place_id.$place_image_section\"><img src=\"$place_image_small_file_href\"/></a></td><td valign=\"top\"><a href=\"_gwcgi_?a=d&amp;d=p$place_id.$place_image_section\"><span class=\"cictext\">$place_image_name</span></a></td></tr>\n";
 		}
 		else {
@@ -940,5 +940,5 @@
 	    }
 
-	    $designer_places_list_html .= "<tr><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$designer_place_id\"><img src=\"$designer_place_image_small_file_href\"/></a></td><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$designer_place_id\">$designer_place_name</a>, $designer_place_institution_name<br /><b>Date of construction:</b> $designer_place_construction_date_value</td></tr>\n";
+	    $designer_places_list_html .= "<tr><td valign=\"top\"><a href=\"_gwcgi_?a=d&amp;d=p$designer_place_id\"><img src=\"$designer_place_image_small_file_href\"/></a></td><td valign=\"top\"><a href=\"_gwcgi_?a=d&amp;d=p$designer_place_id\">$designer_place_name</a>, $designer_place_institution_name<br /><b>Date of construction:</b> $designer_place_construction_date_value</td></tr>\n";
 	}
 
@@ -1273,7 +1273,7 @@
 	my $id = $full_name_to_id_mapping{$full_names[$i]};
 	my $name = $id_to_name_mapping->{$id};
-	$name =~ s/'/&apos;/g;  # ' # (for Emacs)
+	# $name =~ s/'/&apos;/g;  # ' # (for Emacs)
 	my $extra = $id_to_extra_mapping->{$id} || "";
-	print BROWSER_MACROFILE "<td valign=\"top\"><a href=\"_gwcgi_?a=d&d=$id\">$name</a>$extra</td>";
+	print BROWSER_MACROFILE "<td valign=\"top\"><a href=\"_gwcgi_?a=d&amp;d=$id\">" . &html_safe($name) . "</a>$extra</td>";
 
 	print BROWSER_MACROFILE "<td valign=\"top\">";
@@ -1281,7 +1281,7 @@
 	    $id = $full_name_to_id_mapping{$full_names[$i+$half_point]};
 	    $name = $id_to_name_mapping->{$id};
-	    $name =~ s/'/&apos;/g;  # ' # (for Emacs)
+	    # $name =~ s/'/&apos;/g;  # ' # (for Emacs)
 	    $extra = $id_to_extra_mapping->{$id} || "";
-	    print BROWSER_MACROFILE "<a href=\"_gwcgi_?a=d&d=$id\">$name</a>$extra";
+	    print BROWSER_MACROFILE "<a href=\"_gwcgi_?a=d&amp;d=$id\">" . &html_safe($name) . "</a>$extra";
 	}
 	print BROWSER_MACROFILE "</td>";
@@ -1315,4 +1315,12 @@
 
     close(BROWSER_MACROFILE);
+}
+
+
+sub html_safe
+{
+    my $text = shift(@_);
+    $text =~ s/&/&amp;/g;
+    return $text;
 }
 
