Changeset 12433
- Timestamp:
- 2006-08-11T13:54:05+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cic-hcap/perllib/plugins/CICPlug.pm
r12432 r12433 799 799 my $place_narrative = $place_narrative_sql_handle->fetchrow(); 800 800 if (defined($place_narrative)) { 801 $place_narrative= &rtf_to_html($place_narrative);802 $place_narrative =~ s/<br \/>(\s|\n)*$//; # Remove any trailing <br /> tags803 &new_metadata_entry($place_doc_obj, " Narrative", $place_narrative);801 my $place_narrative_html = &rtf_to_html($place_narrative); 802 $place_narrative_html =~ s/<br \/>(\s|\n)*$//; # Remove any trailing <br /> tags 803 &new_metadata_entry($place_doc_obj, "PlaceNarrativeHTML", $place_narrative_html); 804 804 } 805 805 … … 981 981 982 982 # Convert the place references from RTF to HTML 983 my $place_references_html_ string= &rtf_to_html($place_references_rtf_string);984 if ($place_references_html_ string=~ / (http|www\.)/) {983 my $place_references_html_raw = &rtf_to_html($place_references_rtf_string); 984 if ($place_references_html_raw =~ / (http|www\.)/) { 985 985 print STDERR "<ProcessingError n='Place $place_id' p='CICPlug' r='Warning: Found possible web address in references without hyperlink tag.'>\n" if ($self->{'gli'}); 986 986 print STDERR "Warning: Place $place_id -- Found possible web address in references without hyperlink tag.\n"; 987 987 print $fail_log_handle "Warning: Place $place_id -- Found possible web address in references without hyperlink tag.\n"; 988 988 } 989 &new_metadata_entry($place_doc_obj, "PlaceReferences", $place_references_html_string);990 989 991 990 # Split the references and try to parse title and author 992 $place_references_html_string =~ s/(\r|\n)//g; 993 my @place_references = split(/<br \/><br \/>/, $place_references_html_string); 991 my $place_references_html = ""; 992 $place_references_html_raw =~ s/(\r|\n)//g; 993 my @place_references = split(/<br \/><br \/>/, $place_references_html_raw); 994 994 foreach my $place_reference (@place_references) { 995 $place_reference =~ s/^(<br \/>\s*)*//; 995 996 $place_reference =~ s/(<br \/>\s*)*$//; 996 997 next if ($place_reference !~ /\w/); 997 998 &new_metadata_entry($place_doc_obj, "Reference", $place_reference); 999 $place_references_html .= "<p class=\"cicreference\">" . $place_reference . "</p>\n"; 998 1000 999 1001 # Case 0: A magic word in the first sentence … … 1020 1022 } 1021 1023 } 1024 1025 &new_metadata_entry($place_doc_obj, "PlaceReferencesHTML", $place_references_html); 1022 1026 } 1023 1027
Note:
See TracChangeset
for help on using the changeset viewer.