You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 18f7388
Browse filesBrowse the repository at this point in the historyBrowse files
Addresses the three LOW items the previous reviewer pass flagged but
that had been deferred:
* Extract the "concat all TEXT_NODE children" pattern into a single
module-level helper `xml_editor.get_text_node_data`. Replace the
four inline copies (build_text_map, add_xml_space_to_t,
_parse_comment, RevisionManager._get_node_text) with calls into
it. The method on RevisionManager stays as a thin delegate so
call sites and any external subclasses remain unchanged.
* `_get_element_text` now treats a whitespace-only TEXT_NODE child
as content when its parent carries `xml:space="preserve"`, not
only when it sits alongside a meaningful-text sibling. Closes the
edge case where a lone-space `<w:t xml:space="preserve"> </w:t>`
was incorrectly returned as the empty string by `contains=` search.
* New focused unit test for `_set_node_text` asserts the contract
directly: starting from a multi-TEXT_NODE state, ends with exactly
one TEXT_NODE carrying the new content. Catches future
"simplifications" that re-introduce the `firstChild.data =` pattern
without an integration regression.
* New test covering the `xml:space="preserve"` branch of
`_get_element_text`.
0 commit comments