renderConsoleMarkdown function
text with its console markdown rendered: as ANSI styling when styled,
else as plain text, the markers removed and any escape code dropped.
Implementation
String renderConsoleMarkdown(String text, {required bool styled}) {
final rendered = text.toConsole();
return styled ? rendered : rendered.replaceAll(_sgr, '');
}