Skip to content

docs write --markdown --append emits literal bullets + per-line code paragraphs (no native list, no contiguous code block) #594

Description

@sebsnyk

Version

gog 0.17.0 (Homebrew 2026-05-15T18:03:28Z)

Symptom

gog docs write <docId> --tab=<tab> --file=<md> --markdown --append does not produce the expected paragraph styles for two common markdown constructs:

1. Bullet lists → literal paragraphs

Source markdown:

- **Item A** — description.
- **Item B** — description.
- **Item C** — description.

After append, the resulting paragraphs are NORMAL_TEXT (not bulleted) with the bullet glyph inlined as text:

[NORMAL|Arial] • Item A — description.
[NORMAL|Arial] • Item B — description.
[NORMAL|Arial] • Item C — description.

Expected: BULLET paragraph style (native Google Docs list), no literal glyph.

For comparison, the same markdown pushed via gog docs create --file --markdown (no --append) does produce native BULLET paragraphs.

2. Fenced code blocks → per-line Courier New paragraphs

Source markdown:

```
line 1
line 2
line 3
```

After append, each line becomes its own NORMAL_TEXT paragraph with Courier New font. There is no continuous code block, no paragraph background, no Format → Preformatted paragraph style applied. Visually this reads as "N separate one-line code styled paragraphs" rather than one block.

Expected: a single contiguous code-styled block (whatever style is currently produced by docs create --file --markdown for fenced code; that path renders correctly).

Repro

cat > /tmp/repro.md <<'MD'
# Heading

Intro paragraph.

- **First** — bullet one.
- **Second** — bullet two.

Pipeline:

\`\`\`
stage 1
stage 2
stage 3
\`\`\`

End paragraph.
MD

# Set up a doc + tab to write into:
docId=$(gog docs create "Test gog append" --json | jq -r .documentId)
gog docs add-tab $docId --title=Test --index=1

# This is the failing path:
gog docs write $docId --tab=Test --file=/tmp/repro.md --markdown --append

# Inspect via --raw to confirm paragraph styles
gog docs read $docId --tab=Test --raw | jq '...'

Expected vs actual

Source MD Expected paragraphStyle Actual paragraphStyle
- foo (bullet) BULLET (native list, no literal glyph) NORMAL_TEXT with literal prefix in text run
```…fenced code… ``` One contiguous code block N separate NORMAL_TEXT paragraphs each set to Courier New

Workaround

Manual paste — pandoc -t html <md> \| <html-to-clipboard-helper> then Cmd+V into the target tab. Produces correct native bullets and a contiguous code block. The API path is unusable for any markdown containing bullet lists or fenced code blocks until this is fixed.

Context

Related to #592 (table insertion in the same --append --markdown path). Both bugs point at the converter used specifically in docs write --markdown --appenddocs create --file --markdown does not exhibit either failure mode, so the converter is duplicated or different across the two paths.

For agent-driven doc-update workflows (write into existing multi-tab specs), the --append --markdown path is the natural choice; until it produces parity with docs create, every non-trivial doc update has to be done by hand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions