Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit b2671d1

Browse files
authored
Merge branch 'Fox2Code:master' into master
2 parents 1032edb + 9f480c7 commit b2671d1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/src/main/java/com/fox2code/mmm/markdown/MarkdownActivity.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
7979
} catch (IOException e) {
8080
// Workaround GitHub README.md case sensitivity issue
8181
if (url.startsWith("https://raw.githubusercontent.com/") &&
82-
url.endsWith("/README.md")) { // Try with lowercase version
83-
rawMarkdown = Http.doHttpGet(url.substring(0,
84-
url.length() - 9) + "readme.md", true);
82+
url.endsWith("/README.md")) {
83+
String prefix = url.substring(0, url.length() - 9);
84+
try { // Try with lowercase version
85+
rawMarkdown = Http.doHttpGet(prefix + "readme.md", true);
86+
} catch (IOException ignored) { // Try with .github version
87+
rawMarkdown = Http.doHttpGet(prefix + ".github/README.md", true);
88+
}
8589
} else throw e;
8690
}
8791
String markdown = new String(rawMarkdown, StandardCharsets.UTF_8);

0 commit comments

Comments
 (0)