MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / strip_frontmatter

Function strip_frontmatter

scripts/lint_note.py:1477–1479  ·  view source on GitHub ↗

Remove a leading YAML frontmatter block (---...---) if present.

(text: str)

Source from the content-addressed store, hash-verified

1475
1476
1477def 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
1482def main() -> None:

Calls

no outgoing calls