[CLI] Move Markup.Escape(...) to ConsoleExtensions

pull/605/head
Tyrrrz 4 years ago
parent 0ec6027a93
commit 021682899a

@ -14,7 +14,6 @@ using DiscordChatExporter.Core.Exceptions;
using DiscordChatExporter.Core.Exporting;
using DiscordChatExporter.Core.Exporting.Partitioning;
using DiscordChatExporter.Core.Utils.Extensions;
using Spectre.Console;
using Tyrrrz.Extensions;
namespace DiscordChatExporter.Cli.Commands.Base
@ -65,7 +64,7 @@ namespace DiscordChatExporter.Cli.Commands.Base
// Export
try
{
await progressContext.StartTaskAsync(Markup.Escape($"{channel.Category} / {channel.Name}"), async progress =>
await progressContext.StartTaskAsync($"{channel.Category} / {channel.Name}", async progress =>
{
var guild = await Discord.GetGuildAsync(channel.GuildId);

@ -33,7 +33,11 @@ namespace DiscordChatExporter.Cli.Utils.Extensions
string description,
Func<ProgressTask, ValueTask> performOperationAsync)
{
var progressTask = progressContext.AddTask(description, new ProgressTaskSettings {MaxValue = 1});
var progressTask = progressContext.AddTask(
// Don't recognize random square brackets as style tags
Markup.Escape(description),
new ProgressTaskSettings {MaxValue = 1}
);
try
{

Loading…
Cancel
Save