Skip to content

fix(docs): format markdown append writes#530

Closed
eric-x-liu wants to merge 1 commit intoopenclaw:mainfrom
eric-x-liu:codex/docs-markdown-append-format
Closed

fix(docs): format markdown append writes#530
eric-x-liu wants to merge 1 commit intoopenclaw:mainfrom
eric-x-liu:codex/docs-markdown-append-format

Conversation

@eric-x-liu
Copy link
Copy Markdown

Summary

  • allow gog docs write --append --markdown to append converted Google Docs formatting instead of raw Markdown text
  • reuse the existing Docs API Markdown parser/formatter for append writes while preserving Drive-based Markdown replacement
  • add a regression test and README example for formatted Markdown append

Root Cause

docs write --markdown only supported full replacement through Drive's Markdown conversion path. Append writes used Docs API InsertText, which inserts Markdown syntax literally unless gogcli converts formatting into Docs API requests first.

Fixes #272

Tests

  • go test ./internal/cmd -run 'TestDocsWrite|TestMarkdownToDocsRequests' -count=1
  • git diff --check

@steipete
Copy link
Copy Markdown
Collaborator

Thanks @eric-x-liu. I rebuilt this on current main to fit the new Docs tab/editing path and landed it as 65db353.

What landed:

  • docs write --append --markdown now uses Docs API batchUpdate formatting requests instead of appending raw Markdown syntax.
  • docs write --replace --markdown stays on the existing Drive conversion path.
  • Added regression coverage for the append path and updated README/changelog.

Verification:

  • go test ./internal/cmd -run 'TestDocsWrite_Markdown|TestDocsWriteFileValidation|TestMarkdownToDocsRequests' -count=1\n- live Docs smoke against steipete@gmail.com: created a temporary Doc, wrote base text, appended # Live Heading / **live bold** with --append --markdown, read it back without raw Markdown syntax leaking, then deleted the Doc.\n- make ci\n\nClosing this draft PR as landed via maintainer commit 65db353. The commit includes your co-author trailer.

@steipete steipete closed this Apr 27, 2026
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.

Docs write: Markdown not rendered when using API

2 participants