Commit bcadb7b
fix(docs): keep markdown append tables from being dropped
Fix `gog docs write --append --markdown` dropping native tables with `insert native table: table not found near index N` when the Docs API reports the inserted table start outside the old +/-2 lookup window.
Maintainer fixups:
- Restricted the nearest-table lookup to matching row/column dimensions so a nearby unrelated table cannot be selected.
- Added the required changelog thanks for @sebsnyk.
Proof:
- go test ./internal/cmd -run 'TestInsertDocsMarkdownAt|TestPickTableNear|TestNextTableInsertOffset|TestBuildTableCellRequests|TestParseMarkdown|TestMarkdownToDocsRequests' -count=1
- make ci
- codex-review --parallel-tests "go test ./internal/cmd -run 'TestInsertDocsMarkdownAt|TestPickTableNear|TestNextTableInsertOffset|TestBuildTableCellRequests|TestParseMarkdown|TestMarkdownToDocsRequests' -count=1"
- Live Google Docs test with [email protected]: created a disposable doc, added a TableTest tab, appended markdown containing prose plus a table through docs write --tab TableTest --file ... --markdown --append, read the tab back with docs cat --tab TableTest --json --wrap-untrusted and verified both table rows were present, then trashed the doc.
- GitHub CI and docker checks green on c8d8c6e after rerunning an initial Windows setup-go infrastructure flake.
Co-authored-by: Sebastian Roth <[email protected]>
Co-authored-by: Claude Opus 4.7 <[email protected]>1 parent 3a1b155 commit bcadb7b
3 files changed
Lines changed: 481 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
0 commit comments