etichete: cinci cifre scoase de sub candele in modulul 5; si randarea lui, reparata

Cele cinci erau toate in patternuri_complexe_3: "SL 29.40" se citea cu 9.4
lipsa, "target 62.00" fara 62., "intrare short 89.00" fara 8. Reparate cu
Level.i0, care muta si linia si eticheta - label_dy doar le-ar fi lipit de
linia vecina. Nicio cifra schimbata.

Si o regresie a mea, din 29dc93d: marcajul <!--SVG0--> pe care il pune
stash_svgs semana cu ancorele <!--SVG:tb--> ale generatoarelor din modulul 5,
deci assert-ul se aprindea degeaba si **niciun capitol din modulul 5 nu se mai
putea randa**. Marcajul e acum <!--SVG-STASH-n-->, iar assert-ul cauta exact
forma lui. Cele 7 capitole se randeaza din nou.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ThN7ixZrowca8aTGrK1MUJ
This commit is contained in:
Claude Agent
2026-10-02 06:13:41 +00:00
parent 84f933bcfa
commit 973410823e
10 changed files with 220 additions and 148 deletions

View File

@@ -159,7 +159,10 @@ def stash_svgs(text: str) -> tuple[str, list[str]]:
def scoate(m: re.Match) -> str:
pastrate.append(m.group(0))
return f"<!--SVG{len(pastrate) - 1}-->"
# marcaj propriu: capitolele au deja comentarii „<!--SVG:tb-->"
# puse de generatoarele lor, iar un marcaj care semăna cu ele
# aprindea assert-ul de mai jos degeaba
return f"<!--SVG-STASH-{len(pastrate) - 1}-->"
return re.sub(r"<svg .*?</svg>", scoate, text, flags=re.S), pastrate
@@ -169,9 +172,9 @@ def render_file(md_path: Path) -> tuple[Path, str]:
check_svgs(md_path, text)
fara_svg, svgs = stash_svgs(text)
body = markdown.markdown(fara_svg, extensions=["extra", "toc"])
body = re.sub(r"(?:<p>\s*)?<!--SVG(\d+)-->(?:\s*</p>)?",
body = re.sub(r"(?:<p>\s*)?<!--SVG-STASH-(\d+)-->(?:\s*</p>)?",
lambda m: svgs[int(m.group(1))], body)
assert "<!--SVG" not in body, f"{md_path}: marcaj de SVG rămas în pagină"
assert "<!--SVG-STASH-" not in body, f"{md_path}: marcaj de SVG rămas în pagină"
body = link_md_to_html(md_path, body)
title = text.splitlines()[0].lstrip("# ").strip() if text else md_path.stem
top, bottom = nav_html(md_path, title)