forked from docs/doc-exports
fixing checking of attribute
This commit is contained in:
parent
e463db0379
commit
11ffa0d4d8
@ -265,10 +265,8 @@ class OTCDocConvertor:
|
|||||||
for lnk in soup.body.find_all("a"):
|
for lnk in soup.body.find_all("a"):
|
||||||
if (
|
if (
|
||||||
lnk.string is None
|
lnk.string is None
|
||||||
and hasattr(lnk, "name")
|
and lnk.has_attr("name")
|
||||||
):
|
and not re.match(r"^li\d+$", lnk.attrs["name"])
|
||||||
if (
|
|
||||||
not re.match(r"^li\d+$", lnk.attrs["name"])
|
|
||||||
# anywhere section
|
# anywhere section
|
||||||
and not re.match(r".*section\d+$", lnk.attrs["name"])
|
and not re.match(r".*section\d+$", lnk.attrs["name"])
|
||||||
# starts with table
|
# starts with table
|
||||||
@ -277,8 +275,8 @@ class OTCDocConvertor:
|
|||||||
# Verify this is really called from somewhere:
|
# Verify this is really called from somewhere:
|
||||||
local_ref = lnk["name"].lower()
|
local_ref = lnk["name"].lower()
|
||||||
if self.is_element_referred(local_ref, file_name):
|
if self.is_element_referred(local_ref, file_name):
|
||||||
# We now know something in the document wants this
|
# We now know something in the document wants this anchor -
|
||||||
# anchor - replace it with label
|
# replace it with label
|
||||||
if local_ref not in page_anchors:
|
if local_ref not in page_anchors:
|
||||||
logging.debug("Adding anchor")
|
logging.debug("Adding anchor")
|
||||||
lnk.name = "p"
|
lnk.name = "p"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user