feat: Phase D.13: Insert paragraph/table at arbitrary position#99
feat: Phase D.13: Insert paragraph/table at arbitrary position#99citconv-agents[bot] wants to merge 2 commits intomasterfrom
Conversation
Add ability to insert paragraphs and tables at specific positions: - Paragraph.insert_paragraph_after(text, style) - Paragraph.insert_table_after(rows, cols, width) - Table.insert_paragraph_after(text, style) - CT_Body.insert_before(new_element, reference_element) - _Body.insert_element_before(new_element, reference_element) Uses lxml addnext()/addprevious() on underlying elements. Verified existing insert_paragraph_before() works correctly. Closes #26 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Security Agent Report SECURITY_PASS Security Review Report — PR #99Branch: agent/issue-26 SummaryNo security issues found. All changes are internal XML tree manipulation using trusted lxml operations. Files Reviewed
AnalysisXML/XXE InjectionCLEAN. New elements are created via User Text HandlingCLEAN. The optional Path TraversalCLEAN. No file system operations in any changed code. New DependenciesCLEAN. No new external dependencies introduced. Secrets / Sensitive DataCLEAN. No API keys, tokens, passwords, or credentials present. Element Insertion SafetyCLEAN. ConclusionThe PR adds |
|
Review Agent REVIEW_CHANGES_NEEDED SummaryThe new Issue 1: Dead code —
|
- Remove dead code: `_Body.insert_element_before` and `CT_Body.insert_before` (never called from live code paths) - Fix architecture inconsistency: move XML manipulation from proxy layer to oxml layer by adding `CT_P.add_tbl_after` and `CT_Tbl.add_p_after` methods - Update `Paragraph.insert_table_after` and `Table.insert_paragraph_after` to delegate to the new oxml-layer methods instead of calling `addnext` directly - Add unit tests for the new oxml-layer methods Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Security Agent Report SECURITY_PASS Security Review Report — PR #99Date: 2026-04-05 SummaryNo security issues found. The changes are safe to merge. Changes Reviewed
Security ChecksXML Injection / XXEPASS. No raw user-supplied XML strings are parsed anywhere in these changes.
Path TraversalPASS. No file paths are handled in these changes. Dependency RiskPASS. No new dependencies are introduced. No changes to Secrets / CredentialsPASS. No API keys, tokens, passwords, or other credentials present. Data ExposurePASS. No file I/O, no network calls, no logging of sensitive data. Input ValidationPASS.
ConclusionAll changes are narrow, internal API additions that follow established patterns in the python-docx codebase. No security concerns were identified. |
|
Review Agent REVIEW_CHANGES_NEEDED SummaryThe PR adds Issue: Wrong type cast in
|
Summary
Implements #26
This PR was automatically generated by the Developer Agent.
Original Issue
Add ability to insert paragraphs and tables at specific positions. Upstream python-openxml#156 (23 comments).
API Design
Implementation
Uses lxml's addnext()/addprevious() on the underlying elements. The high-level methods create the element and position it.
Upstream issue: python-openxml#156
Generated by Developer Agent using Claude Code