Skip to content

bug(docs write --tab --markdown): strikethrough ~~text~~ renders as literal text instead of struck-through #702

Description

@sebsnyk

Symptom

gog docs write --replace --markdown --tab=<id> does not honour CommonMark / GFM strikethrough syntax (~~text~~). The two tilde pairs and the inner text render as plain literal text instead of producing struck-through formatting (Docs API textStyle.strikethrough = true).

Strikethrough is part of GitHub-Flavored Markdown, which gog's markdown converter otherwise supports (**bold**, *italic*, fenced code blocks, tables, etc. all render correctly via the same path).

Repro

echo -e '# Strike test\n\n~~struck out~~ vs **bold** vs *italic*\n' > /tmp/strike.md
DOC=$(gog docs create "strike test" --pageless --file /tmp/strike.md -j | jq -r .id)
gog docs tabs add "$DOC" --title "Tab 2"
TAB=$(gog docs list-tabs "$DOC" -j | jq -r '.tabs[1].id')

# Push the same markdown via the --tab path:
gog docs write "$DOC" --replace --markdown --tab="$TAB" --file /tmp/strike.md

# Verify in the rendered tab:
gog docs read "$DOC" --tab="$TAB"
# Observed:  ~~struck out~~ vs bold vs italic    (tildes survive as literal text)
# Expected:  struck out vs bold vs italic        (struck out should be struck through)

# Confirm in the raw structure — no strikethrough textStyle landed:
gog docs raw "$DOC" -j | jq '.body.content[].paragraph?.elements[]?.textRun?.textStyle?.strikethrough? // empty'
# Observed: no occurrences.

Expected behaviour

~~text~~ from the input markdown should produce a textRun span with textStyle.strikethrough = true in the resulting Doc body — mirroring how **bold** produces textStyle.bold = true today.

Acceptance criteria

  • ~~text~~ in the input markdown produces a textRun with textStyle.strikethrough = true for the inner text on both the gog docs write --replace --markdown --tab=<id> (per-tab) and gog docs write --replace --markdown (whole-doc Drive-import) paths.
  • The tilde markers are not preserved as visible characters in the rendered doc.
  • An --no-strikethrough opt-out is not needed; this should match the other GFM inline styles which require no opt-in.

References

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