update
This commit is contained in:
@@ -26,6 +26,15 @@ def _title(entry: str) -> str:
|
||||
return entry.split(" — ")[0].strip() or entry
|
||||
|
||||
|
||||
def clean_title(s: str) -> str:
|
||||
"""Strip markdown noise from a DISPLAY title (norm keys use _norm_title).
|
||||
Only clearly-markdown characters go: `**` pairs and backticks. Single `*`,
|
||||
underscores and pipes stay — they are legitimate in math titles
|
||||
(„2|prec, pi∈{1,2}|Cmax", „x_i", „P*")."""
|
||||
s = (s or "").replace("**", "").replace("`", "")
|
||||
return re.sub(r"\s+", " ", s).strip()
|
||||
|
||||
|
||||
def _unique_title(entries: dict[int, str]) -> dict[int, str]:
|
||||
"""Make titles unique (suffix " (2)", " (3)" …) so they work as keys."""
|
||||
seen: dict[str, int] = {}
|
||||
|
||||
Reference in New Issue
Block a user