8231122: @index tag with newline causes tag search to fail

Reviewed-by: jjg
This commit is contained in:
Hannes Wallnöfer 2019-09-24 11:49:48 +02:00
parent a63b541842
commit 8743f0b6d1
5 changed files with 19 additions and 11 deletions

View file

@ -110,7 +110,8 @@ public class TagletWriterImpl extends TagletWriter {
String tagText = ch.getText(itt.getSearchTerm());
if (tagText.charAt(0) == '"' && tagText.charAt(tagText.length() - 1) == '"') {
tagText = tagText.substring(1, tagText.length() - 1);
tagText = tagText.substring(1, tagText.length() - 1)
.replaceAll("\\s+", " ");
}
String desc = ch.getText(itt.getDescription());

View file

@ -312,7 +312,7 @@ public class Links {
* @return a valid HTML name
*/
public String getName(String name) {
return name.replaceAll(" +", "");
return name.replaceAll("\\s+", "");
}
}