Skip to content

Commit f2a4885

Browse files
jmartiskbschuhmann
authored andcommitted
Split the possible config values into multiple lines
1 parent 3aadc8f commit f2a4885

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/src/main/java/io/quarkus/docs/generation/AssembleDownstreamDocumentation.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class AssembleDownstreamDocumentation {
6262
private static final String SOURCE_BLOCK_PREFIX = "[source";
6363
private static final String SOURCE_BLOCK_DELIMITER = "--";
6464
private static final Pattern FOOTNOTE_PATTERN = Pattern.compile("footnote:([a-z0-9_-]+)\\[(\\])?");
65-
private static final Pattern TOOLTIP_PATTERN = Pattern.compile("tooltip:([a-z0-9_-]+)\\[(.*?)\\]");
65+
private static final Pattern TOOLTIP_PATTERN = Pattern.compile("tooltip:([a-z0-9_-]+)\\[(.*?)\\](, ?)?");
6666

6767
private static final String PROJECT_NAME_ATTRIBUTE = "{project-name}";
6868
private static final String RED_HAT_BUILD_OF_QUARKUS = "Red Hat build of Quarkus";
@@ -485,7 +485,14 @@ private static String rewriteContent(String fileName,
485485
});
486486

487487
content = TOOLTIP_PATTERN.matcher(content).replaceAll(mr -> {
488-
return "*" + mr.group(1) + "*: " + mr.group(2);
488+
// group(1) is the enum value, group(2) is the tooltip text for the value
489+
if (mr.group(3) != null) {
490+
// group(3) is a comma that means there are still more values after this one
491+
// So in this case, replace it with two newlines to visually separate items
492+
return "*" + mr.group(1) + "*: " + mr.group(2) + "\n\n";
493+
} else {
494+
return "*" + mr.group(1) + "*: " + mr.group(2);
495+
}
489496
});
490497

491498
return content;

0 commit comments

Comments
 (0)