MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / _flush_current

Function _flush_current

dataflow_agent/utils_markdown_sections.py:152–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150 preamble_lines: List[str] = []
151
152 def _flush_current() -> None:
153 nonlocal current_lines, current_title, current_path
154 content = "".join(current_lines).strip()
155 if not content:
156 current_lines = []
157 return
158 sections.append({
159 "title": current_title or "Untitled Section",
160 "heading_path": list(current_path) if current_path else [current_title or "Untitled Section"],
161 "content": content,
162 "order_index": len(sections),
163 "estimated_tokens": estimate_text_tokens(content),
164 })
165 current_lines = []
166
167 for line in lines:
168 match = _HEADING_RE.match(line.strip("\n"))

Callers 1

Calls 2

listFunction · 0.85
estimate_text_tokensFunction · 0.85

Tested by

no test coverage detected