class StringTool {
  static  String stripMarkdown(String input) {
    if (input.isEmpty) return input;

    var output = input;
    output = output.replaceAllMapped(
      RegExp(r'(\*{1,3}|_{1,3})(.*?)\1'),
          (m) => m.group(2) ?? '',
    );
    return output.replaceAll("\n", "");
  }
}