Ignore:
Timestamp:
2020-07-03T12:18:35+12:00 (4 years ago)
Author:
ak19
Message:

The previous commit fixed the issue where HTML in collection descriptions was not being preserved when GLI was not involved. This commit fixes the remaining problems with preserving HTML in coll descriptions when GLI is involved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java

    r20448 r34241  
    162162     */
    163163    public void setValue(String raw_value) {
     164    setValue(raw_value, false);
     165    }
     166
     167    public void setValue(String raw_value, boolean preserveTags) {
    164168    // we need to check if the value has changed
    165169    String current_value = XMLTools.getValue(element);
    166     String new_value = Codec.transform(raw_value, Codec.TEXT_TO_DOM);
     170   
     171    String new_value = preserveTags ?
     172        Codec.transform(raw_value, Codec.TEXT_TO_DOM_PRESERVE_TAGS)
     173        : Codec.transform(raw_value, Codec.TEXT_TO_DOM);
    167174    if (!current_value.equals(new_value)) {
    168     // Only raw html text can be given to setValue so we need to encode it
     175        // Only raw html text can be given to setValue so we need to encode it
    169176        XMLTools.setValue(element, new_value);
    170177        text = null; // Reset text
Note: See TracChangeset for help on using the changeset viewer.