mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Add Utilities.MarkdownToText() (#903)
* Add Utilities.MarkdownToText()
* Add GET /Api/WWW/MarkdownToText?text={text} and sort usings alphabetically
* Revert sorting usings
* Sort functions
* Remove Log if the user is at fault
* Rename variable and adjust if for errors
This commit is contained in:
committed by
Łukasz Domeradzki
parent
b247ba6167
commit
18cd620db8
@@ -177,6 +177,21 @@ namespace ArchiSteamFarm {
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static string MarkdownToText(string markdownText) {
|
||||
if (string.IsNullOrEmpty(markdownText)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(markdownText));
|
||||
return null;
|
||||
}
|
||||
|
||||
string plainText = Markdig.Markdown.ToPlainText(markdownText);
|
||||
if (plainText == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(plainText));
|
||||
return null;
|
||||
}
|
||||
|
||||
return plainText;
|
||||
}
|
||||
|
||||
internal static int RandomNext() {
|
||||
lock (Random) {
|
||||
return Random.Next();
|
||||
|
||||
Reference in New Issue
Block a user