Skip to content

Commit 48d1910

Browse files
committed
Handle missing TOC and Jira macros
1 parent 297f863 commit 48d1910

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

confluence_markdown_exporter/confluence.py

+8
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ def convert_jira_table(self, el: BeautifulSoup, text: str, parent_tags: list[str
568568
"div", {"class": "jira-table"}
569569
)
570570

571+
if len(jira_tables) == 0:
572+
print("No Jira table found. Ignoring.")
573+
return text
574+
571575
if len(jira_tables) > 1:
572576
print("Multiple Jira tables are not supported. Ignoring.")
573577
return text
@@ -579,6 +583,10 @@ def convert_toc(self, el: BeautifulSoup, text: str, parent_tags: list[str]) -> s
579583
"div", {"class": "toc-macro"}
580584
)
581585

586+
if len(tocs) == 0:
587+
print("Could not find TOC macro. Ignoring.")
588+
return text
589+
582590
if len(tocs) > 1:
583591
print("Multiple TOC macros are not supported. Ignoring.")
584592
return text

0 commit comments

Comments
 (0)