Skip to content

Commit

Permalink
Replace [#anchors] with [[anchors]] in downstream documentation
Browse files Browse the repository at this point in the history
(cherry picked from commit cdd343f)
  • Loading branch information
gsmet committed Feb 7, 2024
1 parent a33aa54 commit 7f77c9b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class AssembleDownstreamDocumentation {
Pattern.CASE_INSENSITIVE);
private static final Pattern ANGLE_BRACKETS_WITH_DESCRIPTION_PATTERN = Pattern.compile("<<([a-z0-9_\\-#\\.]+?),([^>]+?)>>",
Pattern.CASE_INSENSITIVE);
private static final Pattern ANCHOR_PATTERN = Pattern.compile("^\\[#([a-z0-9_-]+)]$",
Pattern.CASE_INSENSITIVE + Pattern.MULTILINE);
private static final String SOURCE_BLOCK_PREFIX = "[source";
private static final String SOURCE_BLOCK_DELIMITER = "--";

Expand Down Expand Up @@ -448,6 +450,10 @@ private static String rewriteLinks(String fileName,
return "link:" + QUARKUS_IO_GUIDES_ATTRIBUTE + "/" + mr.group(1);
});

content = ANCHOR_PATTERN.matcher(content).replaceAll(mr -> {
return "[[" + mr.group(1) + "]]";
});

return content;
}

Expand Down

0 comments on commit 7f77c9b

Please sign in to comment.