Remove a leading YAML frontmatter block (---...---) if present.
(text: str)
| 1475 | |
| 1476 | |
| 1477 | def strip_frontmatter(text: str) -> str: |
| 1478 | """Remove a leading YAML frontmatter block (---...---) if present.""" |
| 1479 | return re.sub(r"^---\n.*?\n---\n?", "", text, count=1, flags=re.DOTALL) |
| 1480 | |
| 1481 | |
| 1482 | def main() -> None: |
no outgoing calls