Paper Office
paper-docxAPI referencesearch

ReplaceResult

paper-docx 0.2.0 API reference

Outcome of a Span.replace call.

deleted_text and inserted_text cover the whole span for an untracked replace but only the affix-trimmed middle for a tracked one, so comparing them against Span.text is wrong for tracked edits. preserved_formatting_regions reports whether an ordinary replacement kept every changed formatting region rather than intentionally inheriting the changed interval's starting run properties; for a no-op, it records that no formatting changed. It is independent of revision evidence.

ReplaceResult(story: str, deleted_text: str, inserted_text: str, tracked: bool, revision_ids: Tuple[int, ...], preserved_revision_ids: Tuple[int, ...] = (), preserved_formatting_regions: bool = False)

Attributes

deleted_text

attributedeleted_textstr

inserted_text

attributeinserted_textstr

preserved_formatting_regions

attributepreserved_formatting_regionsbool
= False

preserved_revision_ids

attributepreserved_revision_idsTuple[int, ...]
= ()

revision_ids

attributerevision_idsTuple[int, ...]

story

attributestorystr

tracked

attributetrackedbool

Functions

to_dict

functo_dict() -> dict

Returns

dict

On this page