Another fixes for the conversion

Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
gtema 2022-10-24 07:32:30 +00:00 committed by zuul
parent ea69076d8b
commit 5c39c0abbb

View File

@ -148,6 +148,7 @@ class OTCDocConvertor:
del img["class"]
del img["title"]
del img["name"]
del img["id"]
figure.append(img)
i.replace_with(figure)
elif "section" in i.get("class", []):
@ -452,6 +453,12 @@ class OTCDocConvertor:
# Preprocess - Fix space inside link and not text
# i.e. `<p>Some <a>link </a>in text</p>
content = re.sub(r"\s</a>", "</a> ", content)
content = re.sub(r"", "Y", content)
content = re.sub(r"×", "x", content)
content = re.sub(r"π", "Pi", content)
content = re.sub(r"", "-", content)
content = re.sub(r"", "<=", content)
content = re.sub(r"", ">=", content)
soup = bs4.BeautifulSoup(content, "lxml")
proc = self.streamline_html(soup, f.name)
@ -513,8 +520,6 @@ class OTCDocConvertor:
logging.info("Dropping not referred anchor")
continue
processed_line = re.sub(r"", "Y", processed_line)
processed_line = re.sub(r"π", "Pi", processed_line)
processed_line = re.sub(
r"public_sys-resources/", "", processed_line
)