Merge pull request #310 from Teqniksoft/kiryl/converter_fix

Change processing of anchor ids
This commit is contained in:
bivis
2022-10-21 19:06:01 +03:00
committed by GitHub

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,