解析 sources[] 里的一条字符串(典型如 "[[wiki/sources/X]]" 或 "[[raw/papers/X]]"), 返回 (target_file_exists, resolved_md_path)。 非 wikilink 字符串(纯文本 caption 等)返回 (True, None) — 无法校验,跳过。
(src: str)
| 1115 | |
| 1116 | |
| 1117 | def _resolve_source_entry(src: str) -> tuple[bool, str | None]: |
| 1118 | """解析 sources[] 里的一条字符串(典型如 "[[wiki/sources/X]]" 或 "[[raw/papers/X]]"), |
| 1119 | 返回 (target_file_exists, resolved_md_path)。 |
| 1120 | |
| 1121 | 非 wikilink 字符串(纯文本 caption 等)返回 (True, None) — 无法校验,跳过。 |
| 1122 | """ |
| 1123 | links = parse_wikilinks(src) |
| 1124 | if not links: |
| 1125 | return True, None |
| 1126 | target_norm = normalize_link_target(links[0].target) |
| 1127 | full_path = PROJECT_ROOT / target_norm |
| 1128 | return full_path.exists(), target_norm |
| 1129 | |
| 1130 | |
| 1131 | def _has_block_citation(content: str) -> bool: |
no test coverage detected