Fix extracting source file with type specification.
This commit is contained in:
parent
ed567afbea
commit
3ef1339cc0
@ -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…
x
Reference in New Issue
Block a user