Try to fix `/*` combination

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-11-04 12:05:05 +00:00 committed by zuul
parent f1cb839979
commit 891fd0ac38

View File

@ -306,6 +306,10 @@ class OTCDocConvertor:
new = f"<code>{em.string}</code>"
em.replace_with(bs4.BeautifulSoup(new, "html.parser"))
for p in soup.body.find_all(string=re.compile(r"(/\*)")):
if p.string and p.parent.name == "p":
p.string.replace_with(p.string.replace("/*", "/``*``"))
escape_asterisk_re = r"\((\*)[\.,]"
for p in soup.body.find_all(string=re.compile(escape_asterisk_re)):
if p.string: