File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -272,12 +272,12 @@ def parse_markdown_code(markdown_code: str) -> CodeStringsMarkdown:
272272
273273 """
274274 matches = markdown_pattern .findall (markdown_code )
275- results = CodeStringsMarkdown ()
275+ code_string_list = []
276+ for file_path , code in matches :
277+ path = file_path .strip ()
278+ code_string_list .append (CodeString (code = code , file_path = Path (path )))
276279 try :
277- for file_path , code in matches :
278- path = file_path .strip ()
279- results .code_strings .append (CodeString (code = code , file_path = Path (path )))
280- return results # noqa: TRY300
280+ return CodeStringsMarkdown (code_strings = code_string_list )
281281 except ValidationError :
282282 # if any file is invalid, return an empty CodeStringsMarkdown for the entire context
283283 return CodeStringsMarkdown ()
You can’t perform that action at this time.
0 commit comments