Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Validate content / validate',
name: 'validate',
head_sha: '${{ steps.create-pr.outputs.pull-request-head-sha }}',
status: 'completed',
conclusion,
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/preview/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function parseContentFile(filename: string, ref: string, headers: Record<s
slug: data.slug,
name: data.name,
shortDescription: data.shortDescription ?? "",
description: description.trim(),
description: description?.trim() ?? "",
banner: toRawUrl(data.banner, ref),
logo: toRawUrl(data.logo, ref),
tags: data.tags ?? [],
Expand Down
5 changes: 3 additions & 2 deletions src/lib/parse-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ function extractField(content: string, label: string): string {
if (linkMatch) {
return /url/i.test(label) ? linkMatch[2].trim() : linkMatch[1].trim();
}
return match[1].trim();
// Strip backtick code spans
return match[1].trim().replace(/^`(.*)`$/, "$1");
}

function parseLegacyMetadata(markdown: string): IssueMetadata {
Expand Down Expand Up @@ -198,7 +199,7 @@ export function parseList(markdown: string, sectionName: string): string[] {
line
.replace(/^-\s*/, "") // strip leading "- " or "-"
.split(",") // handle comma-separated values
.map((s) => s.replace(/^`(.*)`$/, "$1").trim())
.map((s) => s.replace(/^`(.*)`$/, "$1").replace(/^"(.*)"$/, "$1").trim())
.filter((s) => s && s !== "-");

// Legacy format: bullet points (- slug)
Expand Down
3 changes: 2 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}

export function calcReadTime(text: string): number {
export function calcReadTime(text: string | undefined | null): number {
if (!text) return 1;
const wordCount = text.trim().split(/\s+/).filter(Boolean).length;
return Math.max(1, Math.ceil(wordCount / 265));
}
Expand Down
Loading