v0.5.3
Example document / build (push) Has been cancelled
Python application / build (push) Has been cancelled

- Мелкие исправления увеличивающие работу конвертера
This commit is contained in:
Igor20264
2026-09-10 10:50:15 +03:00
parent 658036f920
commit f7136bd8bd
95 changed files with 7165 additions and 8771 deletions
+2 -8
View File
@@ -2,7 +2,7 @@
from __future__ import annotations
import re
from mdexport.labels import sanitize_label
_SPECIAL = {
"\\": r"\textbackslash{}",
@@ -32,11 +32,5 @@ def escape_verbatim_for_listing(s: str) -> str:
return s.replace("\\end{lstlisting}", "\\end\\{lstlisting}")
_LABEL_RE = re.compile(r"[^\w\-]+", re.UNICODE)
def latex_label(name: str | None, prefix: str = "obj") -> str:
if not name:
return prefix
cleaned = _LABEL_RE.sub("-", name.strip()).strip("-")
return f"{prefix}:{cleaned or 'x'}"
return sanitize_label(name, prefix, ":")