fix(patch): use regex to detect line-number prefix to avoid corrupting pipe chars

This commit is contained in:
alireza78a 2026-03-11 21:51:25 +03:30 committed by teknium1
parent 0bb7ed1d95
commit 1182aeea00

View file

@ -359,7 +359,7 @@ def _apply_update(op: PatchOperation, file_ops: Any) -> Tuple[bool, str]:
# Parse content (remove line numbers)
current_lines = []
for line in read_result.content.split('\n'):
if '|' in line:
if re.match(r'^\s*\d+\|', line):
# Line format: " 123|content"
parts = line.split('|', 1)
if len(parts) == 2: