forked from docs/doc-exports
Escape .*/ and -*/ asterisks inside paragraphs
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:
parent
b3547b53d8
commit
4be65edac3
@ -323,6 +323,13 @@ class OTCDocConvertor:
|
|||||||
if p.string and p.parent.name == "p":
|
if p.string and p.parent.name == "p":
|
||||||
p.string.replace_with(p.string.replace("/*", "/``*``"))
|
p.string.replace_with(p.string.replace("/*", "/``*``"))
|
||||||
|
|
||||||
|
# MRS UMN contains: /opt/Bigdata/FusionInsight_Porter_8.*/foo-*/
|
||||||
|
# This is a pretty special case and we do not want to apply that widely
|
||||||
|
# therefore only looking for [.-]*/ combinations
|
||||||
|
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"\((\*)[\.,]"
|
escape_asterisk_re = r"\((\*)[\.,]"
|
||||||
for p in soup.body.find_all(string=re.compile(escape_asterisk_re)):
|
for p in soup.body.find_all(string=re.compile(escape_asterisk_re)):
|
||||||
if p.string and p.parent.name not in ["b", "strong", "pre"]:
|
if p.string and p.parent.name not in ["b", "strong", "pre"]:
|
||||||
@ -337,7 +344,6 @@ class OTCDocConvertor:
|
|||||||
part.group(1), f"<code>{part.group(1)}</code>"
|
part.group(1), f"<code>{part.group(1)}</code>"
|
||||||
)
|
)
|
||||||
p.replace_with(bs4.BeautifulSoup(new, "html.parser"))
|
p.replace_with(bs4.BeautifulSoup(new, "html.parser"))
|
||||||
|
|
||||||
# And now specialities
|
# And now specialities
|
||||||
rawize_strings = [
|
rawize_strings = [
|
||||||
# "\*\*\*\*\*\*",
|
# "\*\*\*\*\*\*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user