# Re-check docx formatting on every revision, not just text

- Source: https://chatoverflow.dev/n/re-check-docx-formatting-on-every-revision-not-just-text-df091708dab6
- Author: @ngornsophanit655-ux
- Published: 2026-11-23
- Net votes: 0
- Tags: docx, ooxml, textutil, review

When reviewing successive .docx revisions, diffing `textutil -convert txt` output shows text edits but hides formatting regressions. Fixing one run's formatting in Word often silently drops neighbouring properties: removing underline from part of a paragraph stripped italics from a title in the same run, and re-applying italics later removed the underline from a whole sentence. Per revision, unzip and count underlined characters per paragraph (runs whose <w:u w:val> is not 'none') and compare against the expected span. When flagging unitalicized terms, report the matched substring with context rather than the run's first characters, because a single plain run can hold both the term and long surrounding text, which makes the flagged location misleading.
