Skip to content

Fix markdown rendering: indent RPC message code blocks under bullet points#716

Merged
lpcox merged 3 commits intomainfrom
copilot/fix-markdown-rendering-issues
Feb 5, 2026
Merged

Fix markdown rendering: indent RPC message code blocks under bullet points#716
lpcox merged 3 commits intomainfrom
copilot/fix-markdown-rendering-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

MCP Gateway logs with RPC messages containing JSON code blocks rendered inconsistently in GitHub Actions step summaries. Code blocks appeared at root level instead of nested under their parent bullet point.

Before:

- 🔍 rpc **safeoutputs**`tools/call`

```json
{"method":"tools/call","params":{...}}

**After:**
```markdown
- 🔍 rpc **safeoutputs**→`tools/call`
  
  ```json
  {"method":"tools/call","params":{...}}

## Changes

- **`internal/logger/markdown_logger.go`**: When pre-formatted RPC messages contain newlines, indent continuation lines with 2 spaces
- **`internal/logger/markdown_logger_test.go`**: Verify JSON code blocks and closing fences are properly indented

RPC messages are identified by `**prefix` and directional arrows (`→`/`←`). Single-line messages unchanged.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by firewall rules:
>
> - `example.com`
>   - Triggering command: `/tmp/go-build2425374583/b271/launcher.test /tmp/go-build2425374583/b271/launcher.test -test.testlogfile=/tmp/go-build2425374583/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a hmk22mfXY 5945597/b043=&gt;` (dns block)
> - `invalid-host-that-does-not-exist-12345.com`
>   - Triggering command: `/tmp/go-build2425374583/b259/config.test /tmp/go-build2425374583/b259/config.test -test.testlogfile=/tmp/go-build2425374583/b259/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/c-p UMBkIjOef 5945597/b030=&gt;` (dns block)
> - `nonexistent.local`
>   - Triggering command: `/tmp/go-build2425374583/b271/launcher.test /tmp/go-build2425374583/b271/launcher.test -test.testlogfile=/tmp/go-build2425374583/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a hmk22mfXY 5945597/b043=&gt;` (dns block)
> - `slow.example.com`
>   - Triggering command: `/tmp/go-build2425374583/b271/launcher.test /tmp/go-build2425374583/b271/launcher.test -test.testlogfile=/tmp/go-build2425374583/b271/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a hmk22mfXY 5945597/b043=&gt;` (dns block)
> - `this-host-does-not-exist-12345.com`
>   - Triggering command: `/tmp/go-build2425374583/b280/mcp.test /tmp/go-build2425374583/b280/mcp.test -test.testlogfile=/tmp/go-build2425374583/b280/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go1.25.6 -c=4 -nolocalimports -importcfg /tmp/go-build2425374583/b233/importcfg -pack /opt/hostedtoolcache/go/1.25.6/x64/src/net/mail/message.go ortc�� 64/src/runtime/cgo 64/src/internal/saferio/io.go ache/go/1.25.6/x64/pkg/tool/linux86_64-linux-gnu` (dns block)
>
> If you need me to access, download, or install something from one of these locations, you can either:
>
> - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent) (admins only)
>
> </details>

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>better markdown rendering</issue_title>
> <issue_description>See https://github.com/github/gh-aw/actions/runs/21722241500
> 
> It's somewhat inconsistent rendering.</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>


> **Custom agent used: agentic-workflows**
> GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes github/gh-aw-mcpg#715

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/github/gh-aw-mcpg/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 5, 2026 18:03
…essages

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inconsistent markdown rendering Fix markdown rendering: indent RPC message code blocks under bullet points Feb 5, 2026
Copilot AI requested a review from lpcox February 5, 2026 18:06
@lpcox lpcox marked this pull request as ready for review February 5, 2026 18:20
Copilot AI review requested due to automatic review settings February 5, 2026 18:20
@lpcox lpcox merged commit d4d7bed into main Feb 5, 2026
3 checks passed
@lpcox lpcox deleted the copilot/fix-markdown-rendering-issues branch February 5, 2026 18:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes markdown rendering issues in GitHub Actions step summaries where JSON code blocks in RPC log messages were appearing at the root level instead of nested under their parent bullet points.

Changes:

  • Modified markdown logger to indent continuation lines of multi-line RPC messages with 2 spaces
  • Added test assertions to verify JSON code blocks and closing fences are properly indented
  • RPC messages are identified by ** prefix and directional arrows (/); single-line messages remain unchanged

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/logger/markdown_logger.go Added logic to split multi-line pre-formatted (RPC) messages and indent continuation lines with 2 spaces for proper markdown nesting
internal/logger/markdown_logger_test.go Updated comment and added test assertions to verify JSON code blocks are indented with 2 spaces under bullet points

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants