Skip to content

Commit 297f863

Browse files
committed
Handle page id null
1 parent b07bd05 commit 297f863

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

confluence_markdown_exporter/confluence.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,9 @@ def convert_a(self, el: BeautifulSoup, text: str, parent_tags: list[str]) -> str
637637
return self.convert_a(fallback, text, parent_tags) # type: ignore -
638638
return f"[[{text}]]"
639639
if "page" in str(el.get("data-linked-resource-type")):
640-
page_id = el.get("data-linked-resource-id")
641-
return self.convert_page_link(int(str(page_id)))
640+
page_id = str(el.get("data-linked-resource-id", ""))
641+
if page_id and page_id != "null":
642+
return self.convert_page_link(int(page_id))
642643
if "attachment" in str(el.get("data-linked-resource-type")):
643644
return self.convert_attachment_link(el, text, parent_tags)
644645
if match := re.search(r"/wiki/.+?/pages/(\d+)", str(el.get("href", ""))):

0 commit comments

Comments
 (0)