Ignore:
Timestamp:
2023-09-04T15:00:41+12:00 (10 months ago)
Author:
kjdon
Message:

added a formatNewLines method, to replace \n with <br/>. Useful for data coming from csv, which gets \n added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r37957 r38004  
    760760    }
    761761
     762    public static String formatNewLines(String str, String lang) {
     763    if (str == null || str.length() < 1)
     764        {
     765            return null;
     766        }
     767    return str.replace("\\n", "<br/>");
     768    }   
    762769    public static String escapeNewLines(String str)
    763770    {
     
    902909            {
    903910                String key = keys.nextElement();
    904                 if (key.startsWith(prefix))
     911                if (key.startsWith(prefix+"."))
    905912                {
    906913                    int lastDotIndex = StringUtils.lastIndexOf(key, '.');
Note: See TracChangeset for help on using the changeset viewer.