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.

Location:
main/trunk/gli/src/org/greenstone/gatherer/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/Codec.java

    r28995 r34241  
    4545    static final public String GREENSTONE_TO_TEXT = "GREENSTONE_TO_TEXT";
    4646    static final public String TEXT_TO_DOM = "TEXT_TO_DOM";
     47    static final public String TEXT_TO_DOM_PRESERVE_TAGS = "TEXT_TO_DOM_PRESERVE_TAGS";
    4748    static final public String TEXT_TO_GREENSTONE = "TEXT_TO_GREENSTONE";
    4849    static final public String TEXT_TO_REGEXP = "TEXT_TO_REGEXP";
     
    169170    TRANSFORMS.put(TEXT_TO_DOM, text_to_dom);
    170171    text_to_dom = null;
     172
     173    // Same as above, but preserve html element tags
     174    String[] text_to_dom_preserve_tags = {
     175        "&", "&",
     176        "\"", """,
     177        "\'", "'"
     178    };
     179    TRANSFORMS.put(TEXT_TO_DOM_PRESERVE_TAGS, text_to_dom_preserve_tags);
     180    text_to_dom_preserve_tags = null;
    171181
    172182    // Unescape html (or xml) text
  • main/trunk/gli/src/org/greenstone/gatherer/util/XMLTools.java

    r31776 r34241  
    957957            // And close.
    958958            os.close();
     959
     960            // Useful for debugging unescaped chars that may otherwise break stuff
     961            // w = new StringWriter();
     962            // // Generate a new serializer from the above.
     963            // s = new XMLSerializer(w, f);
     964            // s.asDOMSerializer();
     965            // // Finally serialize the document to file.
     966            // s.serialize(document);
     967
     968            // System.err.println("@@@@ XMLTools: wrote out to doc:\n" + w.toString());
     969           
    959970        }
    960971        catch (Exception exception)
Note: See TracChangeset for help on using the changeset viewer.