mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-02-01 15:56:14 +00:00
fixed image href tag.
This commit is contained in:
parent
40a22d8dd2
commit
0d8e2ef22f
@ -6,6 +6,7 @@ import android.support.annotation.Nullable;
|
||||
import com.fastaccess.BuildConfig;
|
||||
import com.fastaccess.data.dao.NameParser;
|
||||
import com.fastaccess.helper.Logger;
|
||||
import com.fastaccess.provider.markdown.MarkDownProvider;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -56,8 +57,14 @@ public class GithubHelper {
|
||||
continue;
|
||||
}
|
||||
Logger.e(href);
|
||||
String finalSrc = BuildConfig.REST_URL + "repos/" + owner + "/" + repoName + "/contents/" + href;
|
||||
source = source.replace("href=\"" + href + "\"", "href=\"" + finalSrc + "\"");
|
||||
boolean isImage = MarkDownProvider.isImage(href);
|
||||
String link;
|
||||
if (isImage) {
|
||||
link = "https://raw.githubusercontent.com/" + owner + "/" + repoName + "/master/" + href;
|
||||
} else {
|
||||
link = BuildConfig.REST_URL + "repos/" + owner + "/" + repoName + "/contents/" + href;
|
||||
}
|
||||
source = source.replace("href=\"" + href + "\"", "href=\"" + link + "\"");
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user