> I included the instruction to use regular expressions to do the conversion to ANSI.
The viber coders (who I referred to in my comment) aren't giving implementation tips.
What did it give you before you put an implementation tip into your prompt?
=======
FWIW, if you're at all interested, here's my implementation:
def markdown_ansi_code_subst(mdstr: str, src_pattern: str, replacement_start: str, replacement_end: str) -> str:
while src_pattern in mdstr:
mdstr = mdstr.replace(src_pattern, replacement_start, 1)
mdstr = mdstr.replace(src_pattern, replacement_end, 1)
return mdstr
The caller supplies the pattern (`*` for italic, `**` for bold, etc) and a start/end replacement. As you can imagine, I store all of that in a static lookup table.I feel this is more readable than regexes.*