fix: strip images from toc labels (#749)

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
Timothée Mazzucotelli
2026-06-13 10:24:19 +00:00
committed by GitHub
parent 0f11c7fe99
commit e6b55fe6c6
3 changed files with 58 additions and 1 deletions
+2
View File
@@ -180,4 +180,6 @@ def _cleanup_toc_label(html: str) -> str:
html = re.sub(r"<a\s+[^>]+>(.*?)</a>", r"\1", html, flags=re.DOTALL)
# Remove abbreviations
html = re.sub(r"<abbr\s+[^>]+>(.*?)</abbr>", r"\1", html, flags=re.DOTALL)
# Remove images
html = re.sub(r"<img\s+[^>]+>", "", html, flags=re.DOTALL)
return html # noqa: RET504