Fix chapter excerpting to look for any Heading, not just Heading 2.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
89faad1b2b
commit
6b5dac57ff
@ -34,7 +34,7 @@ $ format-novel manuscript.docx --chapters 5 6 7
|
||||
|
||||
This will only include chapters 5, 6, and 7 in the output file, excluding all
|
||||
other chapters. For this to work, the input document must indicate chapter
|
||||
titles with the "Heading 2" style.
|
||||
titles with a "Heading" style.
|
||||
|
||||
|
||||
## Page header
|
||||
|
@ -29,7 +29,7 @@ def filter_chapters(document, chapter_requests):
|
||||
current_chapter_number = 0
|
||||
|
||||
for paragraph in document.paragraphs:
|
||||
if paragraph.style.name == 'Heading 2':
|
||||
if paragraph.style.name.startswith('Heading'):
|
||||
current_chapter_number += 1
|
||||
|
||||
if current_chapter_number not in chapter_numbers:
|
||||
|
Loading…
Reference in New Issue
Block a user