Paper Office
paper-docxAPI referencesearch

docx.search

paper-docx 0.2.0 API reference

Exact and normalized text search over visibility-complete traversal.

find_text matches exact visible text by default, or explicitly normalized text when requested. Both policies assemble across Word's fragmented runs and across paragraph boundaries. The returned Span is the pivotal object of the editing surface: it maps a visible-text interval back to the concrete w:t text atoms that hold it, retains their exact live identity, and is the receiver of the safe replace operations (Span.replace). Its Anchor is inert location evidence, not mutation authority.

Search space and block identity are shared with docx.story (one walker defines both), so a span's location evidence agrees with the outline.

On this page