启发式:文本中有 ≥3 处形如 ` ^h-2-1-abcdef` / ` ^p-12-7d8e9a` 的尾巴 → 视为已加锚。
(text: str)
| 79 | |
| 80 | |
| 81 | def has_anchors(text: str) -> bool: |
| 82 | """启发式:文本中有 ≥3 处形如 ` ^h-2-1-abcdef` / ` ^p-12-7d8e9a` 的尾巴 → 视为已加锚。""" |
| 83 | matches = ANCHOR_DETECT_RE.findall(text) |
| 84 | return len(matches) >= 3 |
| 85 | |
| 86 | |
| 87 | def add_anchors(text: str) -> tuple[str, list[Block]]: |
no outgoing calls