← Back to PRs

#14940: fix(googlechat): convert Markdown formatting to Google Chat markup

by brandonwise open 2026-02-12 20:04 View on GitHub →
channel: googlechat stale size: S
Fixes #14825 ## What Adds a `convertMarkdownToGoogleChat()` function that converts standard Markdown formatting to Google Chat's markup syntax before sending messages. ## Why Google Chat uses different markup than standard Markdown: - `*bold*` (single asterisk) instead of `**bold**` - `~strikethrough~` (single tilde) instead of `~~strikethrough~~` - `_italic_` is the same in both OpenClaw agents output standard Markdown, which renders as literal asterisks/tildes in Google Chat instead of formatted text. ## How - Added `convertMarkdownToGoogleChat(text)` function with simple regex transforms: - `**text**` → `*text*` (bold) - `~~text~~` → `~text~` (strikethrough) - Applied in both `sendGoogleChatMessage()` and `updateGoogleChatMessage()` - Added 8 unit tests covering various formatting scenarios ## Testing - [x] Added unit tests (8 new tests for the conversion function) - [x] `pnpm check` passes (lint + format + tsgo) - [x] `pnpm vitest run extensions/googlechat` passes (18 tests) ## AI-Assisted 🤖 This PR was built with AI assistance (Claude via OpenClaw). - [x] Code reviewed and understood - [x] Lightly tested - [x] Session available on request <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds `convertMarkdownToGoogleChat()` in `extensions/googlechat/src/api.ts` and applies it to outbound Google Chat message send/update so `**bold**` and `~~strike~~` render using Google Chat’s single-character markup. It also adds unit tests covering basic conversion cases. The main issue is that the converter currently rewrites markers inside inline/fenced code blocks, which can corrupt code snippets commonly produced by agents/tools. Either the implementation should skip code regions (as the comment suggests) or the comment/tests should be adjusted to reflect the real behavior. <h3>Confidence Score: 3/5</h3> - Mostly safe to merge, but has a correctness issue that can garble code snippets in Google Chat messages. - Changes are localized with tests, but the markdown conversion runs inside code regions despite the comment indicating it should not, which will break common agent/tool outputs containing fenced or inline code with `**`/`~~`. - extensions/googlechat/src/api.ts <sub>Last reviewed commit: 2b8752f</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs