Skip to content

Commit 25f178e

Browse files
committed
fix processing of arrays
Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
1 parent e186256 commit 25f178e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/src/main/java/io/jooby/adoc/JavadocProcessor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ public PhraseNode process(StructuralNode parent, String clazz, Map<String, Objec
5959
int index = 2;
6060
while (attributes.get(String.valueOf(index)) != null) {
6161
String qualifiedType = attributes.get(String.valueOf(index)).toString();
62-
link.append(qualifiedType.replace("[]", ":A").replace("&#8230;&#8203;", "..."));
62+
link.append(qualifiedType.replace("[]", "%5B%5D").replace("&#8230;&#8203;", "..."));
6363

6464
int start = qualifiedType.lastIndexOf('.');
6565
String simpleName = start > 0 ? qualifiedType.substring(start + 1) : qualifiedType;
6666

67-
text.append(simpleName);
67+
// Code review comment: this feels like a hack but I can't get it to work otherwise
68+
// even when replacing with the escaped version "[\]"
69+
text.append(simpleName.replace("[]", "&#91;&#93;"));
6870

6971
index += 1;
7072

@@ -95,7 +97,6 @@ public PhraseNode process(StructuralNode parent, String clazz, Map<String, Objec
9597
}
9698

9799
private static StringBuilder generateLink(Map<String, Object> attributes) {
98-
99100
String artifact = (String) attributes.getOrDefault("artifact", "jooby");
100101
return new StringBuilder("https://www.javadoc.io/doc/io.jooby/")
101102
.append(artifact)

0 commit comments

Comments
 (0)