Changeset 34243 for main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
- Timestamp:
- 2020-07-03T12:37:50+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
r34242 r34243 2809 2809 * For now it only makes sense to allow a collection's about page description to contain HTML. 2810 2810 * Collection titles may go into a pre tag or text only context or into HTML headings, 2811 * where preserving any HTML in tcoll title would become meaningless or even a hindrance.2811 * where preserving any HTML in coll title would become meaningless or even a hindrance. 2812 2812 * TODO: if users used HTML pre tags, they'll have wanted whitespace preserved. 2813 2813 * TODO There's probably a better way to do this, but I'm unable to think of it. Messy but works. … … 2820 2820 // <displayItem></displayItem> or self-closing(!) <displayItem/> when no text for colldescr 2821 2821 // Remove xml processing instr too by removing <displayItem until first > after that 2822 // this will also handle self-closing tag case2822 // This will also handle the self-closing tag case 2823 2823 String lookFor = "<displayItem"; 2824 2824 int start = text.indexOf(lookFor); … … 2831 2831 2832 2832 // If we have a positive number of lines remaining, it means it wasn't a self-closing 2833 // tag. Remove the closing tag2833 // tag. Need to remove the closing tag 2834 2834 String[] lines = text.split("\\r?\\n"); 2835 2835 text = ""; … … 2837 2837 for (int j = 0; j < lines.length-1; j++) { // skip last line: closing tag 2838 2838 text += lines[j].trim() + "\n"; // Easiest solution: 2839 // trim white space introduced by the one extra level of2840 // indentation intoducedwhen enclosing <dispItem> tags removed2839 // trim white space of the one extra level of indentation 2840 // that became apparent when enclosing <dispItem> tags removed 2841 2841 } 2842 2842 } … … 2846 2846 // while displaying the html as html (without char entities) in the config file editor 2847 2847 2848 return text; //.trim(); // don't want trailing whitespace within displayItem2848 return text; //already trimmed to remove all but final newline 2849 2849 } 2850 2850
Note:
See TracChangeset
for help on using the changeset viewer.