docs push: corrupted output when inserting consecutive italic-wrapped paragraphs containing markdown links
Summary
Pushing markdown that inserts multiple consecutive single-line paragraphs — each italic-wrapped, two of which contain markdown links — produces garbled output in the live Google Doc. Paragraph boundaries collapse into a single line, italic spans re-wrap around the wrong runs, and a link's trailing literal becomes its own span pointing at the same URL.
Observed on main at c131c2d6 (uv tool install "git+https://github.com/think41/extrasuite#subdirectory=client").
Minimal repro
before.md (initial Doc content)
# Minimal Repro
Some intro paragraph.
---
*Sessions 1–2. Session 1: 4/13/26. Session 2: 4/20/26. Next session: before the review.*
*Session 2 notes (full context for the reframes above): [Meeting Notes — 4/20/26](https://docs.google.com/document/d/EXAMPLE_NOTES_DOC_TWO/edit?usp=drive_link)*
after.md (target)
# Minimal Repro
Some intro paragraph.
---
*Sessions 1–3. Session 1: 4/13/26. Session 2: 4/20/26. Session 3: 5/5/26. Next session: 5/26/26.*
*Session 1 notes:* Kicked off The Brief.
*Session 2 notes: [Meeting Notes — 4/20/26](https://docs.google.com/document/d/EXAMPLE_NOTES_DOC_TWO/edit?usp=drive_link)*
*Session 3 notes: [Meeting Notes — 5/5/26](https://docs.google.com/document/d/EXAMPLE_NOTES_DOC_THREE/edit)*
Steps:
- Convert
before.md to a Google Doc (e.g. gws drive files create --upload before.md --upload-content-type text/markdown).
extrasuite docs pull <doc_url> ./pulled.
- Replace
./pulled/tabs/Tab_1.md body with after.md's body, keeping the id: t.0 / title: Tab 1 frontmatter sentinel.
extrasuite docs push ./pulled.
- Re-pull, or open the live Doc.
Logs report Applied 14 document changes. No errors.
Expected (the bottom of the doc)
*Sessions 1–3. Session 1: 4/13/26. Session 2: 4/20/26. Session 3: 5/5/26. Next session: 5/26/26.*
*Session 1 notes:* Kicked off The Brief.
*Session 2 notes: [Meeting Notes — 4/20/26](...DOC_TWO...)*
*Session 3 notes: [Meeting Notes — 5/5/26](...DOC_THREE...)*
Actual
*Sessions 1–3. Session 1: 4/13/26. Session 2: 4/20/26. Session 3: 5/5/26. Next session: 5/26/26.*
*Session 1 notes:* Kicked off The Brief. *Session 2 notes:* [*Meeting Notes — 4/20/26*](...DOC_TWO...) Session 3 notes: [Meeting Notes — 5/5](...DOC_THREE...)[/26](...DOC_THREE...)
Specific symptoms:
- All three single-line paragraphs collapse onto one line — paragraph breaks are gone.
- Italic markers around the third paragraph (
*Session 3 notes: ... *) are dropped entirely.
- Italic markers around the second paragraph (
*Session 2 notes: [link]*) are re-applied to the link text only, not the surrounding label.
- "5/5/26" → split into "5/5" (linked) + "/26" (linked, same URL) — looks like the trailing literal got swept into the link span and then re-split.
This pattern is consistent with index-drift symptoms: insert and updateTextStyle/createParagraphBullets ops interleaving against shifting indices, with formatted runs landing at offsets that don't match the literal content.
Hypothesis
The README explicitly promises "It tracks index drifts and ensures subsequent operations use the correct index" and "Delete and re-insert is a bug." Both seem to be violated when the inserted region contains:
- Multiple consecutive single-line paragraphs,
- Italic spans that surround (rather than are surrounded by) markdown links,
- Adjacent paragraphs with structurally similar text/link patterns.
Larger pushes amplify the issue — a real-world push with similar structural patterns produced ~97 ops and visibly garbled output across ~6 lines of the same shape.
Environment
- Install:
uv tool install "git+https://github.com/think41/extrasuite#subdirectory=client" at c131c2d6.
- Auth:
GOOGLE_WORKSPACE_CLI_TOKEN exchanged from gws auth export --unmasked refresh token (full drive scope, sidesteps drive.file so extrasuite can see a Doc it didn't create).
- macOS 14, Python 3.14.
docs push: corrupted output when inserting consecutive italic-wrapped paragraphs containing markdown linksSummary
Pushing markdown that inserts multiple consecutive single-line paragraphs — each italic-wrapped, two of which contain markdown links — produces garbled output in the live Google Doc. Paragraph boundaries collapse into a single line, italic spans re-wrap around the wrong runs, and a link's trailing literal becomes its own span pointing at the same URL.
Observed on
mainatc131c2d6(uv tool install "git+https://github.com/think41/extrasuite#subdirectory=client").Minimal repro
before.md (initial Doc content)
after.md (target)
Steps:
before.mdto a Google Doc (e.g.gws drive files create --upload before.md --upload-content-type text/markdown).extrasuite docs pull <doc_url> ./pulled../pulled/tabs/Tab_1.mdbody withafter.md's body, keeping theid: t.0 / title: Tab 1frontmatter sentinel.extrasuite docs push ./pulled.Logs report
Applied 14 document changes. No errors.Expected (the bottom of the doc)
Actual
Specific symptoms:
*Session 3 notes: ... *) are dropped entirely.*Session 2 notes: [link]*) are re-applied to the link text only, not the surrounding label.This pattern is consistent with index-drift symptoms: insert and
updateTextStyle/createParagraphBulletsops interleaving against shifting indices, with formatted runs landing at offsets that don't match the literal content.Hypothesis
The README explicitly promises "It tracks index drifts and ensures subsequent operations use the correct index" and "Delete and re-insert is a bug." Both seem to be violated when the inserted region contains:
Larger pushes amplify the issue — a real-world push with similar structural patterns produced ~97 ops and visibly garbled output across ~6 lines of the same shape.
Environment
uv tool install "git+https://github.com/think41/extrasuite#subdirectory=client"atc131c2d6.GOOGLE_WORKSPACE_CLI_TOKENexchanged fromgws auth export --unmaskedrefresh token (fulldrivescope, sidestepsdrive.filesoextrasuitecan see a Doc it didn't create).