Escape markup in CLI

pull/1145/head
Tyrrrz 1 year ago
parent 8d01c6be35
commit b298b45cf7

@ -200,7 +200,7 @@ public abstract class ExportCommandBase : DiscordCommandBase
try try
{ {
await ctx.StartTaskAsync( await ctx.StartTaskAsync(
channel.GetHierarchicalName(), Markup.Escape(channel.GetHierarchicalName()),
async progress => async progress =>
{ {
var guild = await Discord.GetGuildAsync( var guild = await Discord.GetGuildAsync(

@ -80,7 +80,10 @@ public class ExportAllCommand : ExportCommandBase
channels.Add(channel); channels.Add(channel);
ctx.Status($"Fetched '{channel.GetHierarchicalName()}'."); ctx.Status(
Markup.Escape($"Fetched '{channel.GetHierarchicalName()}'.")
);
fetchedChannelsCount++; fetchedChannelsCount++;
} }
} }
@ -114,7 +117,10 @@ public class ExportAllCommand : ExportCommandBase
{ {
channels.Add(thread); channels.Add(thread);
ctx.Status($"Fetched '{thread.GetHierarchicalName()}'."); ctx.Status(
Markup.Escape($"Fetched '{thread.GetHierarchicalName()}'.")
);
fetchedThreadsCount++; fetchedThreadsCount++;
} }
} }
@ -142,7 +148,11 @@ public class ExportAllCommand : ExportCommandBase
{ {
foreach (var dumpChannel in dump.Channels) foreach (var dumpChannel in dump.Channels)
{ {
ctx.Status($"Fetching '{dumpChannel.Name}' ({dumpChannel.Id})..."); ctx.Status(
Markup.Escape(
$"Fetching '{dumpChannel.Name}' ({dumpChannel.Id})..."
)
);
try try
{ {

@ -58,7 +58,8 @@ public class ExportGuildCommand : ExportCommandBase
channels.Add(channel); channels.Add(channel);
ctx.Status($"Fetched '{channel.GetHierarchicalName()}'."); ctx.Status(Markup.Escape($"Fetched '{channel.GetHierarchicalName()}'."));
fetchedChannelsCount++; fetchedChannelsCount++;
} }
} }
@ -90,7 +91,8 @@ public class ExportGuildCommand : ExportCommandBase
{ {
channels.Add(thread); channels.Add(thread);
ctx.Status($"Fetched '{thread.GetHierarchicalName()}'."); ctx.Status(Markup.Escape($"Fetched '{thread.GetHierarchicalName()}'."));
fetchedThreadsCount++; fetchedThreadsCount++;
} }
} }

@ -44,8 +44,7 @@ internal static class ConsoleExtensions
var actualDescription = !string.IsNullOrWhiteSpace(description) ? description : "..."; var actualDescription = !string.IsNullOrWhiteSpace(description) ? description : "...";
var progressTask = context.AddTask( var progressTask = context.AddTask(
// Don't recognize random square brackets as style tags actualDescription,
Markup.Escape(actualDescription),
new ProgressTaskSettings { MaxValue = 1 } new ProgressTaskSettings { MaxValue = 1 }
); );

Loading…
Cancel
Save