mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
Fixed: Fix markdown link generation
The `]` characters in label and `)` characters in url must be escaped.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user