Skip to content

fix(docs): use UTF-16 sed offsets and preserve & replacements#483

Merged
steipete merged 1 commit intoopenclaw:mainfrom
bill492:bill/unb-373-fix-gog-docs-sed-utf-16-offset-bugs-and-brace-formatting
Apr 20, 2026
Merged

fix(docs): use UTF-16 sed offsets and preserve & replacements#483
steipete merged 1 commit intoopenclaw:mainfrom
bill492:bill/unb-373-fix-gog-docs-sed-utf-16-offset-bugs-and-brace-formatting

Conversation

@bill492
Copy link
Copy Markdown
Contributor

@bill492 bill492 commented Mar 27, 2026

Summary

  • fix Google Docs API range calculations in sed formatting paths to use UTF-16 code unit lengths instead of Go byte lengths
  • preserve whole-match & replacements in addressed substitutions after regex expansion
  • add regression coverage for UTF-16 style ranges and s/foo/&/

Testing

  • go build ./...
  • go test ./internal/cmd/... -run Sed -v -count=1

Notes

  • This PR intentionally does not refactor paragraph-addressed brace formatting (runAddressedSubstitute) to emit formatting requests. That bug is real, but it is a larger behavior change and felt too risky to mix into the UTF-16/data-corruption fix.

@steipete steipete merged commit 4185e02 into openclaw:main Apr 20, 2026
1 check passed
@steipete
Copy link
Copy Markdown
Collaborator

Landed on main.

  • Local gate: make ci
  • CI: run 24666775462 green
  • Merge commit: 4185e02
  • Final main after changelog/lint cleanup: 4247608

Thanks @bill492!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants