Changes from https://github.com/juk0de/ChatMastermind.git #1
@ -55,9 +55,10 @@ def message_to_chat(message: dict[str, str],
|
||||
def display_source_code(content: str) -> None:
|
||||
try:
|
||||
content_start = content.index('```')
|
||||
content_start = content.index('\n', content_start) + 1
|
||||
content_end = content.rindex('```')
|
||||
if content_start + 3 < content_end:
|
||||
print(content[content_start + 3:content_end].strip())
|
||||
if content_start < content_end:
|
||||
print(content[content_start:content_end].strip())
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user