fix(docs): preserve markdown paragraph breaks in tabs#662
Conversation
|
Codex review: needs changes before merge. Reviewed May 30, 2026, 2:32 PM ET / 18:32 UTC. Summary Reproducibility: yes. for the original report: the linked issue gives concrete v0.19.0 tab-write round-trip steps, and the PR body reports a live Docs round-trip that confirms the intended paragraph behavior. The table-spacing regression is source-reproducible from the new Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Preserve blank-line paragraph separators between text blocks while suppressing or normalizing empty-line elements directly adjacent to native tables, with focused parser and Docs request regression coverage. Do we have a high-confidence way to reproduce the issue? Yes for the original report: the linked issue gives concrete v0.19.0 tab-write round-trip steps, and the PR body reports a live Docs round-trip that confirms the intended paragraph behavior. The table-spacing regression is source-reproducible from the new Is this the best way to solve the issue? No as currently written: preserving blank-line elements is the right direction for paragraph text, but the implementation should avoid adding extra empty paragraphs around native tables. A narrower fix should keep paragraph preservation while special-casing or normalizing table-adjacent blank lines. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 6bd333a1e141. Label changesLabel changes:
Label justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58fe96e3f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(elements) > 0 && elements[len(elements)-1].Type != MDEmptyLine { | ||
| elements = append(elements, MarkdownElement{Type: MDEmptyLine}) |
There was a problem hiding this comment.
Avoid doubling blank lines around native tables
When Markdown contains the usual blank line before or after a pipe table, this unconditional MDEmptyLine is emitted adjacent to MDTable. The table renderer already writes a placeholder newline for every table (docs_formatter.go:301-303), and the table inserter documents that Google Docs also inserts a newline before the table (docs_table_inserter.go:159-162), so inputs like Intro\n\n| A |...\n\nOutro now gain extra empty paragraphs around the native table rather than preserving the original spacing.
Useful? React with 👍 / 👎.
Summary
docs write --replace --markdown --tab.Fixes #644.
Testing
go test ./internal/cmd -run 'TestDocsWrite_MarkdownReplaceWithTab|TestMarkdownToDocsRequests|TestParseMarkdown'go test ./internal/cmdmake testTesttab, exported Markdown, confirmed expected blank-line paragraphs present and collapsed soft-break form absent.