// Module descriptions come back HTML-encoded (e.g. `&#039;`). Parse as HTML and
// read textContent to resolve entities and strip tags without injecting markup.
// (Full-HTML readmes are rendered via SanitizedHtml instead, not this helper.)
export const decodeHtml = (input?: string | null): string => {
  if (!input) return '';
  const doc = new DOMParser().parseFromString(input, 'text/html');
  return doc.body.textContent ?? '';
};
