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>
This commit is contained in:
@@ -56,13 +56,25 @@ export function buildReleaseParagraph(sections: ChangelogSection[]): string {
|
||||
return `This release ${rest.join(", ")}, and ${last}.`;
|
||||
}
|
||||
|
||||
function toLatinDigits(value: string): string {
|
||||
return value.replace(/[\u0660-\u0669\u06f0-\u06f9]/g, (digit) =>
|
||||
String(
|
||||
digit.charCodeAt(0) -
|
||||
(digit <= "\u0669" ? 0x0660 : 0x06f0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function formatReleaseDate(date: string): string {
|
||||
const parsed = new Date(`${date}T00:00:00`);
|
||||
if (Number.isNaN(parsed.getTime())) return date;
|
||||
|
||||
return new Intl.DateTimeFormat("en-US", {
|
||||
const formatted = new Intl.DateTimeFormat("en-US", {
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
numberingSystem: "latn",
|
||||
}).format(parsed);
|
||||
|
||||
return toLatinDigits(formatted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user