Correctly shows Snudown's header.

This commit is contained in:
Alex Ning 2021-01-08 13:36:30 +08:00
parent 7e5edf92b1
commit 05b8b73043

View File

@ -40,8 +40,9 @@ public class Utils {
StringBuilder regexed = new StringBuilder(markdown
.replaceAll("((?<=[\\s])|^)/[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com$0)")
.replaceAll("((?<=[\\s])|^)[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com/$0)")
.replaceAll("\\^{2,}", "^"));
.replaceAll("\\^{2,}", "^").replaceAll("#(?![# ])", "# "));
//Fix superscript
int startIndex = regexed.indexOf("^");
while (startIndex >= 0 && startIndex + 1 < regexed.length()) {
char currentChar = regexed.charAt(startIndex + 1);