Changeset 34243


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

Minor.

File:
1 edited

Legend:

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

    r34242 r34243  
    28092809     * For now it only makes sense to allow a collection's about page description to contain HTML.
    28102810     * Collection titles may go into a pre tag or text only context or into HTML headings,
    2811      * where preserving any HTML int coll title would become meaningless or even a hindrance.
     2811     * where preserving any HTML in coll title would become meaningless or even a hindrance.
    28122812     * TODO: if users used HTML pre tags, they'll have wanted whitespace preserved.
    28132813     * TODO There's probably a better way to do this, but I'm unable to think of it. Messy but works.
     
    28202820    // <displayItem></displayItem> or self-closing(!) <displayItem/> when no text for colldescr
    28212821    // Remove xml processing instr too by removing <displayItem until first > after that
    2822     // this will also handle self-closing tag case
     2822    // This will also handle the self-closing tag case
    28232823    String lookFor = "<displayItem";
    28242824    int start = text.indexOf(lookFor);
     
    28312831
    28322832    // If we have a positive number of lines remaining, it means it wasn't a self-closing
    2833     // tag. Remove the closing tag
     2833    // tag. Need to remove the closing tag
    28342834    String[] lines = text.split("\\r?\\n");
    28352835    text = "";             
     
    28372837        for (int j = 0; j < lines.length-1; j++) { // skip last line: closing tag
    28382838        text += lines[j].trim() + "\n"; // Easiest solution:
    2839                                    // trim white space introduced by the one extra level of
    2840                                    // indentation intoduced when enclosing <dispItem> tags removed
     2839                               // trim white space of the one extra level of indentation
     2840                           // that became apparent when enclosing <dispItem> tags removed
    28412841        }
    28422842    }
     
    28462846               // while displaying the html as html (without char entities) in the config file editor
    28472847   
    2848     return text;//.trim(); // don't want trailing whitespace within displayItem
     2848    return text; //already trimmed to remove all but final newline
    28492849    }
    28502850   
Note: See TracChangeset for help on using the changeset viewer.