/**
* Converts a summary string and optional highlights array into an HTML description.
* Summary becomes a
tag, highlights become a
list.
*/
export function toHtmlDescription(summary?: string, highlights?: string[]): string {
const parts: string[] = [];
if (summary) {
parts.push(`${summary}
`);
}
if (highlights && highlights.length > 0) {
parts.push("");
for (const highlight of highlights) {
parts.push(`- ${highlight}
`);
}
parts.push("
");
}
return parts.join("");
}
/**
* Converts an array of strings into an HTML unordered list.
*/
export function arrayToHtmlList(items: string[]): string {
if (items.length === 0) return "";
return `${items.map((item) => `- ${item}
`).join("")}
`;
}