Updated markdown FAQ links

This commit is contained in:
M66B
2024-02-18 10:45:41 +01:00
parent 07289d20e8
commit 40992cc351
3 changed files with 41 additions and 42 deletions

View File

@@ -85,16 +85,15 @@ public class FragmentDialogMarkdown extends FragmentDialogBase {
String markdown;
String asset = Helper.getLocalizedAsset(context, name);
try (InputStream is = context.getAssets().open(asset)) {
byte[] buffer = new byte[is.available()];
is.read(buffer);
markdown = new String(buffer);
markdown = Helper.readStream(is);
}
String locale = Helper.getFAQLocale();
if (locale != null)
markdown = markdown.replace(
"https://github.com/M66B/FairEmail/blob/master/FAQ.md",
"https://github.com/M66B/FairEmail/blob/master/docs/FAQ-" + locale + ".md");
markdown = markdown
.replace("/FAQ.md#FAQ", "/FAQ.md#faq")
.replace("/FAQ.md#user-content-faq", "/FAQ.md#faq")
.replace(
"https://github.com/M66B/FairEmail/blob/master/FAQ.md",
"https://m66b.github.io/FairEmail/");
Markwon markwon = Markwon.builder(context)
.usePlugin(HtmlPlugin.create())