All checks were successful
PR checks / checks (pull_request) Successful in 2m11s
PLAN.md §16 phase 16, with the org lead's D72-D74 (count of record 74). - Eight pages nested in the Rust group at /docs/rust/runicnpc/ (D72): the overview, Install RunicNPC, Commands, NPC profiles, NPC placements, Cost and caps, Profile fields (the one field reference the editor, rnpc.profile set, the data file and the API all share) and The API. - The API page carries every call, hook and data shape (D62), in the site's own words, with no decision numbers and no per-call version history (D74). Signatures print from src/data/runicnpc.mjs through Signature.astro. - checkReference.mjs gains two sections. Against docs main:runicnpc/API.md: the API version, 24 call and 10 hook signatures, and the field names of the profile, RunicNpc_List rows, placements, routes and owners (D73), plus exactly one <Signature> per call on api.mdx. Against runicnpc-rust main:plugin/RunicNPC.cs: console verbs, permissions, place options and config keys. Six planted drifts all failed before it was trusted. - checkSidebar and checkTerms read nested sidebar groups via flatLabels(). - The Rust overview, Events zones and rewards, and Canonical documents link the new pages; the canonical documents gain the four runicnpc/ docs. Both NPC admin screens were walked on the walk site first (D36); nothing was saved. npm run verify is green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
---
|
|
/**
|
|
* A short description from a data file, rendered inline (PLAN.md §16, phase 16).
|
|
*
|
|
* Reference data in `src/data/` is plain strings, because a check reads the same file. Three
|
|
* inline marks are understood, and nothing else: `code`, **bold**, and [a link](/path/). The
|
|
* text is never parsed as HTML, so a description cannot inject markup.
|
|
*/
|
|
interface Props {
|
|
text: string;
|
|
}
|
|
|
|
const { text } = Astro.props;
|
|
|
|
type Token = { kind: 'text' | 'code' | 'strong'; value: string } | { kind: 'link'; value: string; href: string };
|
|
|
|
const tokens: Token[] = [];
|
|
const pattern = /`([^`]+)`|\*\*([^*]+)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
let last = 0;
|
|
for (const m of String(text ?? '').matchAll(pattern)) {
|
|
if (m.index > last) tokens.push({ kind: 'text', value: text.slice(last, m.index) });
|
|
if (m[1] !== undefined) tokens.push({ kind: 'code', value: m[1] });
|
|
else if (m[2] !== undefined) tokens.push({ kind: 'strong', value: m[2] });
|
|
else tokens.push({ kind: 'link', value: m[3], href: m[4] });
|
|
last = m.index + m[0].length;
|
|
}
|
|
if (last < text.length) tokens.push({ kind: 'text', value: text.slice(last) });
|
|
---
|
|
|
|
{tokens.map((t) =>
|
|
t.kind === 'code' ? <code>{t.value}</code>
|
|
: t.kind === 'strong' ? <strong>{t.value}</strong>
|
|
: t.kind === 'link' ? <a href={t.href}>{t.value}</a>
|
|
: t.value
|
|
)}
|