perf: don't yaml-parse empty string and get nothing back

*surprise*
This commit is contained in:
Ankush Menat 2025-01-14 18:52:50 +05:30
parent 8682014259
commit 9bd6c95b3f

View file

@ -423,7 +423,7 @@ def get_frontmatter(string):
body = result.group(2)
return {
"attributes": yaml.safe_load(frontmatter),
"attributes": yaml.safe_load(frontmatter) if frontmatter else "",
"body": body,
}