fix TOC entries collapsing to one line in ODT output

This commit is contained in:
Connor Rhodes 2026-04-10 16:34:38 -05:00
parent 920647f67f
commit f734fc015a

View file

@ -141,6 +141,14 @@ def process_markdown(
md_content, md_content,
) )
# Add hard line breaks between consecutive TOC link entries so pandoc
# renders each entry on its own line instead of collapsing them into one paragraph
md_content = re.sub(
r'(\]\([^)]*\))\n(\[)',
r'\1\\\n\2',
md_content,
)
# Insert page break before Table of Contents # Insert page break before Table of Contents
md_content = re.sub( md_content = re.sub(
r'(#{1,3} \*\*Table of Contents\*\*)', r'(#{1,3} \*\*Table of Contents\*\*)',