A calm place to write long-form, and publish it to the open social web.
skypress.blog/
1import { highlightJson } from './highlight';
2import { sanitizeArticleHtml } from './sanitize';
3
4/**
5 * Render a PDS record value as the reader's "view JSON" markup: pretty-print →
6 * syntax-highlight → sanitise, in that order. The order mirrors the article render path
7 * (highlight before sanitise, sanitise last — AGENTS.md #6b): record values come from
8 * arbitrary PDSes, so sanitise is the final gate before the markup reaches the client.
9 */
10export function renderRecordJson( value: unknown ): string {
11 const json = JSON.stringify( value, null, 2 );
12 return sanitizeArticleHtml( highlightJson( json ) );
13}