Files
aragrp/scripts/blockquote-variant-demo.ts
T
ar.badieiandCursor 6cb9e2aac5 feat: auto-detect blockquote and table colors from content
Replace manual hashtags and color cycling with content-tone heuristics for blockquotes and tables, and refine blockquote layout with a centered icon, larger sizing, and clearer contrast over background decorations.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 01:55:50 +03:30

25 lines
900 B
TypeScript

import { detectBlockquoteVariant } from "../lib/blockquote-variant";
import { BLOCKQUOTE_VARIANT_FIXTURES } from "../lib/blockquote-variant.fixtures";
const VARIANT_LABEL = {
yellow: "زرد (هشدار)",
green: "سبز (ارزشمند)",
gray: "طوسی (خنثی)",
} as const;
let passed = 0;
for (const [index, fixture] of BLOCKQUOTE_VARIANT_FIXTURES.entries()) {
const detected = detectBlockquoteVariant(fixture.content, fixture.citation);
const ok = detected === fixture.expected;
if (ok) passed += 1;
console.log(`--- ${index + 1}. ${fixture.label}`);
console.log(`انتظار: ${VARIANT_LABEL[fixture.expected]}`);
console.log(`تشخیص: ${VARIANT_LABEL[detected]} ${ok ? "OK" : "FAIL"}`);
console.log("");
}
console.log(`نتیجه: ${passed}/${BLOCKQUOTE_VARIANT_FIXTURES.length} درست`);
process.exit(passed === BLOCKQUOTE_VARIANT_FIXTURES.length ? 0 : 1);