Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bcadb7b

Browse files
sebsnykclaude
andauthored
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

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- Docs: `docs write --append --markdown` with three or more markdown tables in a single render no longer drifts the per-table insertion offset by one character per table — the trailing punctuation of the paragraph immediately before the third (and any subsequent) table is preserved instead of being split into a standalone paragraph after the table. (#607)
2323
- Docs: `docs write --append --markdown` now expands inline markdown markers (`**bold**`, `*italic*`, `` `code` ``, `[link](url)`) inside table cells into character runs, matching the behaviour outside of tables — previously the markers rendered as literal characters because the table inserter bypassed the inline-formatting pass. (#608)
2424
- Docs: markdown empty-header table rows (e.g. `| | |`) no longer collide with the separator detection — previously `docs write --append --markdown` swallowed both the empty header and the real `|---|---|` separator, leaving the last data row re-parsed as a literal pipe paragraph after the table. (#609)
25+
- Docs: `docs write --append --markdown` no longer silently drops tables with `insert native table: table not found near index N`. The native-table inserter's post-write search used a ±2 code-unit window, but the Docs API's actual table StartIndex can drift further (auto-newline + placeholder paragraph combine to a several-unit shift); the search now picks the closest forward Table element with matching dimensions and a small backward tolerance instead. The `docs create --file --markdown` path was unaffected because it uses Drive's native markdown import end-to-end. (#592) — thanks @sebsnyk.
2526

2627
## 0.17.0 - 2026-05-15
2728

0 commit comments

Comments
 (0)