Changeset 12456


Ignore:
Timestamp:
2006-08-17T13:31:53+12:00 (18 years ago)
Author:
mdewsnip
Message:

Much improved RTF to HTML conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/perllib/plugins/CICPlug.pm

    r12450 r12456  
    965965    $metadata_value = &unicode::ascii2utf8(\$metadata_value);
    966966
    967     # Remove '#' characters around links
     967    # Remove '#' characters around links (!! BAD)
    968968    if ($metadata_value =~ /\#(.*?)\#/) {
    969969    $metadata_value = $1;
     
    990990    # Split the references and try to parse title and author
    991991    my $place_references_html = "";
    992     $place_references_html_raw =~ s/(\r|\n)//g;
    993     my @place_references = split(/<br \/><br \/>/, $place_references_html_raw);
     992    $place_references_html_raw =~ s/(\r|\n)//g;  # Remove all newlines
     993    $place_references_html_raw =~ s/<br \/><i><br \/>/<br \/><br \/><i>/g;  # Move italic tags
     994    my @place_references = split(/<br \/>\s*<br \/>/, $place_references_html_raw);
    994995    foreach my $place_reference (@place_references) {
    995996    $place_reference =~ s/^(<br \/>\s*)*//;
     
    10431044    }
    10441045    }
    1045     $rtf_string =~ s/\\ldblquote /"/g;
    1046     $rtf_string =~ s/\\rdblquote /"/g;
    1047     $rtf_string =~ s/\\rquote /'/g;  # ' # (for Emacs)
     1046    $rtf_string =~ s/\\ldblquote\s/"/g;
     1047    $rtf_string =~ s/\\ldblquote\b/"/g;
     1048    $rtf_string =~ s/\\rdblquote\s/"/g;
     1049    $rtf_string =~ s/\\rdblquote\b/"/g;
     1050    $rtf_string =~ s/\\rquote\s/'/g;  # ' # (for Emacs)
     1051    $rtf_string =~ s/\\rquote\b/'/g;  # ' # (for Emacs)
    10481052    $rtf_string =~ s/\\pard//g;
    10491053    $rtf_string =~ s/\\par/<br \/>/g;
    1050     $rtf_string =~ s/\\ul /<i>/g;
    1051     $rtf_string =~ s/\\ulnone /<\/i>/g;
    1052     $rtf_string =~ s/\\i0 /<\/i>/g;
    1053     $rtf_string =~ s/\\i0\\/<\/i>\\/g;
    1054     $rtf_string =~ s/\\i /<i>/g;
    1055     $rtf_string =~ s/\\i\\/<i>\\/g;
     1054    $rtf_string =~ s/\\ul\s/<i>/g;
     1055    $rtf_string =~ s/\\ul\b/<i>/g;
     1056    $rtf_string =~ s/\\ulnone\s/<\/i>/g;
     1057    $rtf_string =~ s/\\ulnone\b/<\/i>/g;
     1058    $rtf_string =~ s/\\i\s/<i>/g;
     1059    $rtf_string =~ s/\\i\b/<i>/g;
     1060    $rtf_string =~ s/\\i0\s/<\/i>/g;
     1061    $rtf_string =~ s/\\i0\b/<\/i>/g;
    10561062    $rtf_string =~ s/\\~/ /g;
    10571063    $rtf_string =~ s/\\([A-Za-z0-9\-]+)//g;
Note: See TracChangeset for help on using the changeset viewer.