Skip to content

Commit a1d1f07

Browse files
authored
Merge pull request #2285 from Arnaud-de-Grandmaison-ARM/verify-index-fields
Fix verify_index_fields.py so it splits input on yaml's '---'
2 parents 715c135 + 82e59f9 commit a1d1f07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/verify_index_fields.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def extract_frontmatter(path):
3333
content = f.read()
3434
if not content.startswith('---'):
3535
return None
36-
parts = content.split('---', 2)
37-
if len(parts) < 3:
38-
return None
39-
return yaml.safe_load(parts[1])
36+
parts = list(yaml.safe_load_all(content))
37+
if len(parts) >= 2:
38+
return parts[0]
39+
return None
4040

4141
def get_category_from_path(path):
4242
match = re.match(r"content/learning-paths/([^/]+)/", path)

0 commit comments

Comments
 (0)