src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Links.java
equal
deleted
inserted
replaced
98 * @param content the content that should be added to the anchor, |
98 * @param content the content that should be added to the anchor, |
99 * or null, to use an empty comment |
99 * or null, to use an empty comment |
100 * @return a content tree for the marker anchor |
100 * @return a content tree for the marker anchor |
101 */ |
101 */ |
102 public Content createAnchor(String name, Content content) { |
102 public Content createAnchor(String name, Content content) { |
103 return HtmlTree.A_ID(name, (content == null ? EMPTY_COMMENT : content)); |
103 return HtmlTree.A_ID(getName(name), (content == null ? EMPTY_COMMENT : content)); |
104 } |
104 } |
105 |
105 |
106 private static final Content EMPTY_COMMENT = new Comment(" "); |
106 private static final Content EMPTY_COMMENT = new Comment(" "); |
107 |
107 |
108 /** |
108 /** |
310 * |
310 * |
311 * @param name the string that needs to be converted to a valid HTML name |
311 * @param name the string that needs to be converted to a valid HTML name |
312 * @return a valid HTML name |
312 * @return a valid HTML name |
313 */ |
313 */ |
314 public String getName(String name) { |
314 public String getName(String name) { |
315 return name.replaceAll(" +", ""); |
315 return name.replaceAll("\\s+", ""); |
316 } |
316 } |
317 |
317 |
318 } |
318 } |