Change processing of anchor ids

This commit is contained in:
Kiryl
2022-10-21 17:07:08 +03:00
parent a21a4b55b3
commit 51eee2dc80

View File

@@ -309,7 +309,7 @@ class EpubConverter:
@staticmethod
def create_unique_id(href: str, id_: str) -> str:
return re.sub(r"([^\w\s])|_|-", "", href) + re.sub(r"[_-]", "0", id_)
return "id" + re.sub(r'[\W_]+', "", href) + re.sub(r'[\W_]+', "0", id_)
def match_href_to_path_from_toc(self,
cur_file_path: str,