Skip to content

Commit

Permalink
Update update_ml_tutorials.py
Browse files Browse the repository at this point in the history
  • Loading branch information
makseq authored Sep 6, 2024
1 parent f3b4e26 commit 5feaf85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/update_ml_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def parse_readme_file(file_path: str) -> dict:
with open(file_path, 'r') as f:
content = f.read()

header = re.findall(r'^---\n(.*?)\n---\n', content, re.DOTALL)
match = re.search(r"---(.*?)---", test_content, re.DOTALL)
header = match.group(1).strip()
body = re.sub(r'^---\n(.*?)\n---\n', '', content, flags=re.DOTALL).strip()

return {'header': header[0].strip() if header else '', 'body': body}
Expand Down

0 comments on commit 5feaf85

Please sign in to comment.