diff --git a/ops/pipeline-v2/reweave.py b/ops/pipeline-v2/reweave.py index 2d404d30d..518078b01 100644 --- a/ops/pipeline-v2/reweave.py +++ b/ops/pipeline-v2/reweave.py @@ -535,8 +535,8 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str, field_re = re.compile(rf"^{edge_type}:\s*$", re.MULTILINE) inline_re = re.compile(rf'^{edge_type}:\s*\[', re.MULTILINE) - entry_line = f' - "{orphan_title}"' - rw_line = f' - "{orphan_title}|{edge_type}|{date_str}"' + entry_line = f'- {orphan_title}' + rw_line = f'- {orphan_title}|{edge_type}|{date_str}' if field_re.search(fm_text): # Multi-line list exists — find end of list, append @@ -548,7 +548,7 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str, new_lines.append(line) if re.match(rf"^{edge_type}:\s*$", line): in_field = True - elif in_field and not line.startswith(" -"): + elif in_field and not line.startswith(("- ", " -")): # End of list — insert before this line new_lines.insert(-1, entry_line) in_field = False @@ -576,7 +576,7 @@ def _write_edge_regex(neighbor_path: Path, fm_text: str, body_text: str, new_lines.append(line) if re.match(r"^reweave_edges:\s*$", line): in_rw = True - elif in_rw and not line.startswith(" -"): + elif in_rw and not line.startswith(("- ", " -")): new_lines.insert(-1, rw_line) in_rw = False inserted_rw = True