fix TOC entries collapsing to one line in ODT output
This commit is contained in:
parent
920647f67f
commit
f734fc015a
1 changed files with 8 additions and 0 deletions
|
|
@ -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\*\*)',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue