MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _prune_empty_daily_note_sections

Function _prune_empty_daily_note_sections

agents/reading-agent/main.py:2087–2103  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

2085
2086def _prune_empty_daily_note_sections(text: str) -> str:
2087 lines = text.splitlines()
2088 output: List[str] = []
2089 index = 0
2090 while index < len(lines):
2091 line = lines[index]
2092 if line.startswith("# "):
2093 next_index = index + 1
2094 while next_index < len(lines) and not lines[next_index].startswith("# "):
2095 next_index += 1
2096 section_body = "\n".join(lines[index + 1 : next_index]).strip()
2097 if not section_body:
2098 index = next_index
2099 continue
2100 output.append(line)
2101 index += 1
2102 return "\n".join(output).strip()
2103
2104
2105def _sync_obsidian_daily_note(
2106 *,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected