Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#2607 Dashboard JSON highlighter inserts spaces after colons inside string values

Opened by stack72 · 9/28/2026· Shipped 9/28/2026

Problem

The dashboard's JSON syntax highlighter changes what it displays. A value such as "executedAt": "2026-09-28T18:43:51.845Z" renders as "2026-09-28T18: 43: 51.845Z": spaces are inserted after colons inside string values. Timestamps, URLs (https: //) and any string containing :<digits> are shown incorrectly.

Cause

highlightJson in packages/dashboard/src/components/CodeBlock.tsx applies a series of regex replacements over the whole escaped text. The value rules, e.g. /:\s*(\d+(?:\.\d+)?)\b/g → ': <span class="code-number">$1</span>', also match colons inside string values (and inside the spans the string rule already inserted). Each match rewrites :43 as : <span>43</span>, adding a space.

Expected

The highlighter must never change the text, only wrap tokens. Tokenise the JSON in a single pass (strings first, then numbers, booleans and null outside strings), and add a unit test asserting that the highlighted output, with tags stripped and entities decoded, equals the input for strings containing :, :12, https:// and escaped quotes.

Context

Seen while verifying swamp-club#2595: the new data item page shows JSON data through CodeBlock, so incident data timestamps are displayed wrongly there.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 11 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/28/2026, 7:27:06 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/28/2026, 6:59:12 PM

Sign in to post a ripple.