Skip to content

feat: detect AI-tagged ASCII diagrams in text/txt/plaintext fences - #14

Merged
atom-tech9 merged 1 commit into
mainfrom
dev
Jul 14, 2026
Merged

atom-tech9 merged 1 commit into
mainfrom
dev

Conversation

@atom-tech9

Copy link
Copy Markdown
Owner

AI assistants habitually wrap ASCII art in text / plaintext fences, which the previous hard escape hatch forced to plain code. Routing is now centralized in shouldRenderAsDiagram():

  • explicit aliases (ascii, diagram, ascii-art, asciiart, ascii-diagram) always render as diagrams (aliases extended, case-insensitive)
  • untagged AND text/txt/plaintext fences are heuristic-gated: box art becomes a figure, ordinary text stays a plain code block
  • real languages are still never hijacked

Both pre overrides (app renderer + marketing TemplatePage) share the router; docs/cheat-sheet/template copy updated; 51 unit tests green; verified in the browser (text-tagged art → diagram, text-tagged prose → code, plain → code).

Summary

Type of Change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code change that neither fixes a bug nor adds a feature
  • chore — tooling / maintenance
  • test — adding or updating tests
  • perf — performance improvement
  • ci — CI / build changes

Screenshots

Checklist

  • npm run typecheck passes
  • npm run lint passes
  • npm run build passes
  • Follows the project code style (no any, immutable updates, logical CSS)
  • i18n keys added for any new user-facing strings (en and ar)
  • RTL layout verified for UI changes
  • No console.log (uses @/lib/logger)
  • Documentation updated if needed

AI assistants habitually wrap ASCII art in ```text / ```plaintext fences,
which the previous hard escape hatch forced to plain code. Routing is now
centralized in shouldRenderAsDiagram():

- explicit aliases (ascii, diagram, ascii-art, asciiart, ascii-diagram)
  always render as diagrams (aliases extended, case-insensitive)
- untagged AND text/txt/plaintext fences are heuristic-gated: box art
  becomes a figure, ordinary text stays a plain code block
- ```plain is the new hard opt-out (never a diagram)
- real languages are still never hijacked

Both pre overrides (app renderer + marketing TemplatePage) share the router;
docs/cheat-sheet/template copy updated; 51 unit tests green; verified in the
browser (text-tagged art → diagram, text-tagged prose → code, plain → code).
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripto Ready Ready Preview, Comment Jul 14, 2026 5:47pm

Request Review

@atom-tech9
atom-tech9 merged commit 1b60845 into main Jul 14, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 217e807d Deployed Jul 14, 2026 by vercel[bot]
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