fix(docs): size markdown images on write#518
Closed
vinothd-oai wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(docs): size markdown images on write#518vinothd-oai wants to merge 1 commit intoopenclaw:mainfrom
vinothd-oai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Collaborator
|
Thanks @vinothd-oai, landed this on I kept the core fix: Validation performed:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gog docs write --replace --markdownuploads content through Drive--file, default sizing, custom width/height attrs, pageless behavior, and existing output shapeWhy
gog docs create --filealready handles Markdown images in two passes: it strips image Markdown into placeholders before Drive import, then reads the converted Google Doc and inserts images through the Docs API with explicit sizing. That keeps large source images from being imported at their natural dimensions and gives users consistent defaults such as the 468pt max width.gog docs write --replace --markdownwas taking a different path. It sent the raw Markdown body directly to Drive update, which let Drive import image references itself. That bypassed the existing sizing logic, so large images could become oversized in the resulting Google Doc.This change makes the write path follow the same pattern as document creation: extract images first, let Drive convert the cleaned Markdown, then reuse
insertImagesIntoDocsto place remote or local images with the same default and explicit width/height handling.Validation
go test ./internal/cmd -run "TestDocsWrite_Markdown"go test ./internal/cmd -run "TestDocsWrite"git diff --checkNote:
go test ./internal/cmdstill fails locally on an unrelated auth-state-sensitiveTestRequireAccount_Missingbecause this environment hasactual@example.comconfigured.