mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-16 05:51:15 +01:00
Fixed: Fix markdown link generation
The `]` characters in label and `)` characters in url must be escaped.
This commit is contained in:
parent
501d13a0cb
commit
8ee0c5a6ec
1 changed files with 3 additions and 3 deletions
|
|
@ -119,9 +119,9 @@ public class MarkdownUtils {
|
||||||
return "**" + label + "**: " + def + "\n";
|
return "**" + label + "**: " + def + "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getLinkMarkdownString(String label, Object object) {
|
public static String getLinkMarkdownString(String label, String url) {
|
||||||
if (object != null)
|
if (url != null)
|
||||||
return "[" + label + "](" + object + ")";
|
return "[" + label.replaceAll("]", "\\\\]") + "](" + url.replaceAll("\\)", "\\\\)") + ")";
|
||||||
else
|
else
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue