*Initial Plan
* Parse `<w:sectPr>` blocks even when Word nests them inside paragraph
properties and surface them through a new `setSectionProperties` helper so
relationships when reading DOCX files, preventing `r:id` references from
being dropped during serialization
* Add a regression test that rewrites a DOCX to place section
properties inside a paragraph and confirms header/footer variables are
still replaced
* Initial plan
* Add SnapToGrid support for custom styles and paragraphs
- Add SnapToGrid field to ParagraphProperties in both style and document packages
- Add SnapToGrid option to QuickParagraphConfig for custom style creation
- Add SnapToGrid option to ParagraphFormatConfig for paragraph formatting
- Add SetSnapToGrid method to Paragraph for direct control
- Add cloning support for SnapToGrid in style inheritance
- Add test for SnapToGrid functionality
This allows users to disable grid alignment (设置为false可禁用网格对齐), which is
necessary to make custom LineSpacing work correctly when document has grid enabled.
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Improve documentation for SnapToGrid and LineSpacing
- Add clearer documentation for LineSpacing conversion (multiplier × 240 = OOXML units)
- Add comments explaining intentional type duplication between packages
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Update pkg/style/style.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan
* Fix template replacement preserving images and formatting
- Added parseDrawingElement method to parse drawing (image) elements when opening documents
- Added parseInlineDrawing and parseAnchorDrawing for both inline and floating images
- Added supporting parsers for all nested drawing element structures
- Added test case TestTemplateImagePreservation to verify image preservation
- Template replacement now correctly preserves images and their formatting
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Address code review comments: use strings.Contains and fix xmlns parsing
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Initial plan
* Implement complex table cell content features for issue #27
- Add AddCellParagraph method to add paragraphs to table cells
- Add AddCellFormattedParagraph for formatted paragraphs in cells
- Add ClearCellParagraphs and GetCellParagraphs methods
- Add AddNestedTable method for nested tables in cells
- Add AddCellList method with support for various list types
- Add AddCellImage, AddCellImageFromFile, AddCellImageFromData methods
- Add comprehensive tests for all new features
- Add complex_table_demo example demonstrating all features
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Remove accidental binary and update .gitignore
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Initial plan
* Add error return to AddTable and CreateTable functions
- Modified CreateTable to return (*Table, error) instead of *Table
- Modified AddTable to return (*Table, error) instead of *Table
- Updated all test files to handle the new error return
- Updated markdown renderer to handle the new error return
- Added proper validation errors for invalid table configurations
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Update examples and fix test indentation for AddTable/CreateTable changes
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Initial plan
* Fix template variable replacement losing numbering format
- Add parsing for numPr (numbering properties) in parseParagraphProperties
- Add new parseNumberingProperties function to extract ilvl and numId
- Add test TestTemplateNumberingPropertiesPreservation to verify numbering is preserved
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Initial plan
* Fix nested table support in template export
- Add Tables []Table field to TableCell struct to support nested tables
- Add custom MarshalXML for TableCell to ensure proper XML ordering
- Update cloneTableCell to deep clone nested tables
- Update replaceVariablesInTable to recursively process nested tables
- Add test case for nested table template rendering
- All existing tests pass
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Add real-world nested table scenario test
- Add comprehensive test simulating the issue scenario (resume with family members table)
- Test validates nested tables are preserved during template rendering
- Test includes clear success/failure messages for bug verification
- All tests pass successfully
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Initial plan
* Fix markdown soft line break handling in Word conversion
- Add space after text nodes with soft line breaks
- Handle soft line breaks in both regular content and task lists
- Add comprehensive test cases for soft line break scenarios
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
* Add soft linebreak demo example
- Create comprehensive demo showing soft linebreak fix
- Demonstrate various scenarios including tables and formatting
- Include the original issue scenario for verification
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add omitempty to Justification.Val field for XML schema consistency
- Ensures valid XML generation for default/empty alignment values
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add paragraph_format_demo README
- Update README_zh.md with new features
- Add new example to examples list
- Update feature descriptions
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add new paragraph properties: KeepNext, KeepLines, PageBreakBefore, WidowControl, OutlineLevel
- Implement individual setter methods for each property
- Add ParagraphFormatConfig struct for comprehensive formatting
- Add SetParagraphFormat method for one-call configuration
- Remove duplicate type definitions from table.go
- Add comprehensive test coverage for all new features
- Create paragraph_format_demo example
- Update documentation with new features
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add bilingual comment to assertParagraphContent helper
- Update Break struct comment to accurately reflect page break support only
- Add early validation for negative index in RemoveParagraphAt
- Update inline comment for Break field to be concise
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add bilingual documentation for Break struct
- Add inline comment for Break field in Run struct
- Extract assertParagraphContent helper function to reduce test duplication
- Improve test maintainability
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Remove unnecessary variable assignments in example
- Add bounds checking in test to prevent potential panics
- Optimize RemoveParagraphAt to use single iteration instead of double iteration
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add pagination and paragraph deletion to features list in both README files
- Add code examples showing how to use the new features
- Update examples list to include pagination_deletion_demo
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>
- Add Break structure for page breaks in Run
- Implement AddPageBreak() method to add page breaks to documents
- Implement RemoveParagraph() method to delete paragraphs by reference
- Implement RemoveParagraphAt() method to delete paragraphs by index
- Implement RemoveElementAt() method to delete any element by index
- Add comprehensive tests for all new features
- Update template_from_file_demo to use new AddPageBreak() method
- Add pagination_deletion_demo example showing both features
Co-authored-by: ZeroHawkeye <161401688+ZeroHawkeye@users.noreply.github.com>