- Timestamp:
- 2020-01-25T21:11:58+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r15502 r15760 79 79 private final ArrayList<GpxRoute> privateRoutes = new ArrayList<>(); 80 80 /** 81 * Addi dionalywaypoints for this file.81 * Additional waypoints for this file. 82 82 */ 83 83 private final ArrayList<WayPoint> privateWaypoints = new ArrayList<>(); -
trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java
r15007 r15760 15 15 import org.openstreetmap.josm.data.projection.Projecting; 16 16 import org.openstreetmap.josm.tools.Logging; 17 import org.openstreetmap.josm.tools.Utils; 17 18 import org.openstreetmap.josm.tools.date.DateUtils; 18 19 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider; … … 265 266 @Override 266 267 public Object getTemplateValue(String name, boolean special) { 267 if (!special) 268 if (special) { 269 return null; 270 } else if ("desc".equals(name)) { 271 final Object value = get(name); 272 return value instanceof String ? Utils.stripHtml(((String) value)) : value; 273 } else { 268 274 return get(name); 269 else 270 return null; 275 } 271 276 } 272 277 -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r15740 r15760 1990 1990 } 1991 1991 } 1992 1993 /** 1994 * Strips all HTML characters and return the result. 1995 * 1996 * @param rawString The raw HTML string 1997 * @return the plain text from the HTML string 1998 * @since 15760 1999 */ 2000 public static String stripHtml(String rawString) { 2001 // remove HTML tags 2002 rawString = rawString.replaceAll("<.*?>", " "); 2003 // consolidate multiple spaces between a word to a single space 2004 rawString = rawString.replaceAll("\\b\\s{2,}\\b", " "); 2005 // remove extra whitespaces 2006 return rawString.trim(); 2007 } 1992 2008 }
Note:
See TracChangeset
for help on using the changeset viewer.