md_to_code.py updated to handle print functions in the last line

This commit is contained in:
Nicolas Kruse 2025-07-28 15:03:19 +02:00 committed by Nicolas Kruse
parent 77b80a31fc
commit 38709c03ac
1 changed files with 1 additions and 0 deletions

View File

@ -96,6 +96,7 @@ def segments_to_test(segments: Iterable[markdown_segment], script_language: str
ret_block_flag = lines[-1] if (not re.match(r'^[^(]*=', lines[-1]) and ret_block_flag = lines[-1] if (not re.match(r'^[^(]*=', lines[-1]) and
not lines[-1].startswith('import ') and not lines[-1].startswith('import ') and
not lines[-1].startswith('from ') and not lines[-1].startswith('from ') and
not lines[-1].startswith('print(') and
not lines[-1].startswith(' ')) else None not lines[-1].startswith(' ')) else None
# print('Last line: ', ret_block_flag, '-----------', lines[-1]) # print('Last line: ', ret_block_flag, '-----------', lines[-1])