forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 0
Phase D.21: Run splitting at character position #34
Copy link
Copy link
Open
Labels
Description
Add ability to split a run into two runs at a character position.
API Design
- run.split(position) — splits the run at the given character index
- Returns tuple (left_run, right_run)
- Both runs inherit the original run's formatting
- Essential for search/replace (Phase D.10: Search and replace with formatting preservation #23) and comment anchoring
Implementation
- Create a new w:r element with same w:rPr
- Move text after position to the new run
- Insert the new run after the original in the paragraph
Upstream: python-openxml#519 (8 comments)
Reactions are currently unavailable