Changeset 13109


Ignore:
Timestamp:
2006-10-13T11:28:47+13:00 (18 years ago)
Author:
mdewsnip
Message:

Now escapes square brackets in metadata so Greenstone doesn't try to treat the text as metadata elements.

Location:
trunk/cic-hcap/perllib/plugins
Files:
2 edited

Legend:

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

    r13107 r13109  
    10451045    $metadata_value = &unicode::ascii2utf8(\$metadata_value);
    10461046
     1047    # Escape any '[' and ']' characters so Greenstone doesn't try to treat the text as metadata...
     1048    $metadata_value =~ s/\[/&\#91;/g;
     1049    $metadata_value =~ s/\]/&\#93;/g;
     1050
     1051    # ...but don't mess up real metadata references!
     1052    $metadata_value =~ s/&\#91;assocfilepath&\#93;/\[assocfilepath\]/g;
     1053    $metadata_value =~ s/&\#91;parent\(Top\)\:assocfilepath&\#93;/\[parent(Top):assocfilepath\]/g;
     1054
    10471055    # Escape any '&' characters so the metadata is HTML 4 compliant when displayed
    10481056    $metadata_value =~ s/&([^\#])/&$1/g;
  • trunk/cic-hcap/perllib/plugins/CICWordPlug.pm

    r13108 r13109  
    166166    }
    167167
     168    # Escape any '[' and ']' characters so Greenstone doesn't try to treat the text as metadata...
     169    $metadata_value =~ s/\[/&\#91;/g;
     170    $metadata_value =~ s/\]/&\#93;/g;
     171
    168172    # Remove any superscript tags
    169173    $metadata_value =~ s/\<sup\>//g;
Note: See TracChangeset for help on using the changeset viewer.