diff --git a/tldr-sharp/PageParser.cs b/tldr-sharp/PageParser.cs index c5de644..af6841a 100644 --- a/tldr-sharp/PageParser.cs +++ b/tldr-sharp/PageParser.cs @@ -20,6 +20,7 @@ public static class PageParser internal static string ParseLine(string line, bool formatted = false) { + line = line.EscapeMarkup(); return Config.AnsiSupport ? ParseAnsiLine(line, formatted) : ParsePlainLine(line, formatted); } @@ -50,7 +51,7 @@ private static string ParsePlainLine(string line, bool formatted = false) private static string ParseAnsiLine(string line, bool formatted = false) { - var builder = new StringBuilder(line.EscapeMarkup()); + var builder = new StringBuilder(line); foreach (var match in PlaceholderRegex.Matches(line).Reverse()) { if (match.Groups.Count != 3) continue;