Changeset 13853 in josm for trunk/src/org
- Timestamp:
- 2018-05-26T23:13:23+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r13535 r13853 264 264 username = user.getName(); 265 265 } 266 lblUser.setDescription( username);266 lblUser.setDescription(insertWbr(username), false); 267 267 if (user != null && user != User.getAnonymous()) { 268 268 lblUser.setUrl(getUserUrl(username)); … … 276 276 lblUser.setUrl(null); 277 277 } else { 278 lblUser.setDescription( username);278 lblUser.setDescription(insertWbr(username), false); 279 279 lblUser.setUrl(getUserUrl(username)); 280 280 } … … 293 293 } 294 294 295 private static String insertWbr(String s) { 296 return Utils.escapeReservedCharactersHTML(s).replace("_", "_<wbr>"); 297 } 298 295 299 protected static void updateText(Changeset cs, String attr, JTextArea textArea, JLabel label, Changeset oppCs, JComponent container) { 296 300 final String text = cs != null ? cs.get(attr) : null; -
trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
r11416 r13853 13 13 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 14 14 import org.openstreetmap.josm.tools.OpenBrowser; 15 import org.openstreetmap.josm.tools.Utils; 15 16 16 17 /** … … 102 103 */ 103 104 public final void setDescription(String description) { 105 setDescription(description, true); 106 } 107 108 /** 109 * Sets the text part of the URL label. Defaults to the empty string if description is null. 110 * 111 * @param description the description 112 * @param escapeReservedCharacters if {@code true}, HTML reserved characters will be escaped 113 * @since 13853 114 */ 115 public final void setDescription(String description, boolean escapeReservedCharacters) { 104 116 this.description = description == null ? "" : description; 105 this.description = this.description.replace("&", "&").replace(">", ">").replace("<", "<"); 117 if (escapeReservedCharacters) { 118 this.description = Utils.escapeReservedCharactersHTML(this.description); 119 } 106 120 refresh(); 107 121 }
Note:
See TracChangeset
for help on using the changeset viewer.