fix: Doc Maker content duplication bug and add nested/parenthesized list support#321
Merged
Merged
Conversation
…xes an issue where content in lists were being duplicated
…irst list don't display
🔍 Integration Validation ResultsCommit: Changed directories:
✅ Structure Check output✅ Code Check output✅ Tests Check output✅ README Check output✅ Version Check output |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd617f1bf4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…uded in the document
… mixed up with roman numerals
Ilikecarpet
requested changes
May 13, 2026
… items with no new lines in-between
Ilikecarpet
approved these changes
May 14, 2026
Contributor
Ilikecarpet
left a comment
There was a problem hiding this comment.
Looks good, thanks for working on this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Purpose: Fix a bug in the Doc Maker integration where content inside list items was being duplicated due to recursive element traversal stepping down into nested elements within a list item. Also adds support for nested lists, parenthesized numbering formats
(1),(a),(i)etc., and numbered list continuation across document sections.Approach: Adds
recursive=Falseto the top-levelsoup.find_all()call to prevent double-processing of nested elements. Introduces a new_add_list_items()function that recursively handles nested<ul>/<ol>elements with proper OOXML numbering definitions. Adds_post_process_paren_lists()to detect and convert(a),(1),(i)text patterns into proper nested<ol>elements before processing. Implements low-level OOXML numbering helpers (_get_or_create_abstract_num,_create_num,_apply_numbering,_patch_abstract_num_level) to produce correct multilevel Word numbering with consistent hanging indents. Updates_add_formatted_text_to_paragraph()with askip_nested_listsflag to avoid re-processing nested list content.Type of change
Screenshots
Test plan
Exercises the new and fixed list-rendering logic in
parse_markdown_to_docx.doc-maker/tests/test_doc_maker_unit.py:TestParenthesizedListNumbering— verifies nested(a)/(1)/(i)lists share a singlenumId, correctilvlvalues, and correctnumFmtper level.TestMultipleParenListsAfterHeadings— verifies that independent paren lists separated by headings each get their ownabstractNumand all items are numbered.TestMixedNumberedListFormats— verifies all five list styles (1.,(1),(a),(A),(i)) render with the correctnumFmt, parenthesizedlvlText, left-alignment, and consistent hanging indent.TestOrderedListStartOverride— verifies numbered list continuation across headings respects the start number (4. five sixfollowing1. two three).TestNestedNumberedListIndentation— verifies deeply nested (5-level) mixed-format lists produce correctilvl,numFmt, andleftindent values (hanging × (ilvl + 1))..docxfrom a markdown document containing nested and parenthesized lists and open it in Word/LibreOffice to visually confirm no duplication and correct formatting.Author(s) to check