mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-12-01 00:27:17 +00:00
2.5 KiB
2.5 KiB
Inline Markdown Run Titles
Summary
Render run titles with a small allowlist of inline Markdown decoration in the web UI: backticks become <code>, **bold** becomes <strong>, and _italic_ / *italic* becomes <em>. Do not render Markdown block structures, raw HTML, images, or clickable links in titles. Keep the API/server data model unchanged.
Key Changes
- Add
apps/fabro-web/app/components/inline-markdown.tsxexportingInlineMarkdown({ content, className }). - Use
marked'sLexer.lexInline(...)to tokenize inline Markdown, then map tokens to React elements manually. Do not usedangerouslySetInnerHTML. - Supported rendered elements:
codespan-><code>with compact existing-theme styling.strong-><strong>.em-><em>.- plain/escaped text -> React text.
- Unsupported inline syntax renders as safe text:
- links render their label only, no
<a>. - images render alt text only, no
<img>. - raw HTML displays literally as text.
- hard breaks/newlines render as normal title whitespace.
- links render their label only, no
- Replace visible run-title render sites with
InlineMarkdown:- run detail breadcrumb, heading, and delete confirmation in
apps/fabro-web/app/routes/run-detail.tsx. - run list row title in
apps/fabro-web/app/routes/runs.tsx. - workflow run list title in
apps/fabro-web/app/routes/workflow-runs.tsx.
- run detail breadcrumb, heading, and delete confirmation in
- Leave non-visual/plain-text title uses unchanged:
- document metadata title.
- filtering/search.
- API/client/server fields.
Tests
- Add
apps/fabro-web/app/components/inline-markdown.test.tsx. - Cover these cases:
Move from `[server.integrations.github]` to `[run.integrations.github]`renders two<code>elements without visible backticks.**bold**and_italic_render<strong>and<em>.# heading, lists, and blockquotes remain text and do not create block nodes.[label](javascript:alert(1)),, and raw HTML do not createa,img, or HTML nodes.
- Add a small
run-detail.test.tsassertion that a Markdown-formatted run title produces inline<code>in the visible detail heading. - Verify with:
cd apps/fabro-web && bun testcd apps/fabro-web && bun run typecheck
Assumptions
- This is frontend-only; no OpenAPI, Rust server, or stored title migration is needed.
- Links should not be clickable inside run titles because titles already appear inside links and navigation surfaces.
- Only
code,strong, andemare intentionally styled for v1; other Markdown stays textual.