Skip to content

docs write --replace --markdown --tab: paragraph blank lines collapse into soft line breaks #644

@sebsnyk

Description

@sebsnyk

Summary

When using gog docs write --replace --markdown --tab=<title> to rewrite a Google Doc tab from a markdown file, paragraph-level blank lines in the source are collapsed into soft line breaks ( two-space hard-break form) inside a single paragraph, instead of producing separate paragraph elements. The same source markdown rendered through gog docs write --replace --markdown --pageless (whole-doc, no --tab) does preserve paragraph breaks correctly — so it appears to be a --tab path regression.

Verified on gogcli v0.19.0 (Homebrew).

Repro

/tmp/in.md:

## Section heading

Paragraph A.

Paragraph B.

Paragraph C.
DOC_ID=...   # any doc with a tab titled "Test"
gog docs write "$DOC_ID" --replace --markdown --tab "Test" --file /tmp/in.md
gog drive download "$DOC_ID" --format md --out /tmp/out.md
sed -n '/## Section/,$p' /tmp/out.md

Expected (paragraph breaks preserved)

## Section heading

Paragraph A.

Paragraph B.

Paragraph C.

Actual (paragraphs collapsed into soft line breaks)

## Section heading

Paragraph A.  
Paragraph B.  
Paragraph C.

The trailing two-space line-break in the round-trip export indicates the converter wrote these as a single Docs paragraph element with line breaks, not three separate paragraphs.

Comparison with whole-doc path

The same source markdown rendered via gog docs write --replace --markdown --pageless (no --tab flag) produces three separate paragraphs as expected. The behavioural delta is specific to the --tab path.

Impact

  • Long-form status update tabs lose the visual structure they had when authored by hand.
  • The first rewrite of any tab also re-flattens existing paragraphs that were authored manually, because the tab content is round-tripped through the converter.
  • Doubling the blank lines in source (\n\n\n) does not help — it appears the converter normalises blank line count to a single break.

Workaround

Convert paragraphs to bullet list items. Bullet items render with proper list-item spacing in Google Docs, sidestepping the paragraph-flattening behaviour. Not a fix — bullets are the wrong markup for narrative status updates.

Notes

  • + and & escape as \+ and \& in the round-trip, but that is cosmetic in the markdown export and renders correctly in the Doc UI.
  • Heading-level blank lines (around ###) are preserved correctly; the issue is purely paragraph-to-paragraph inside a section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions