The previous implementation used len(codes)-1 in ReplaceAllStringFunc, which caused all placeholders to point to the same (last) index. This resulted in only the last code block being displayed correctly when multiple code blocks were present in a message. Now using a proper counter variable that increments for each match, ensuring each code block gets a unique placeholder index.
13 KiB
13 KiB