function findMetadata()

in tools/rfc-render/fetch-issues.js [77:90]


function findMetadata(issue) {
  const body = issue.body || '';
  const lines = body.split('\n');
  const titleIndex = lines.findIndex(line => line.startsWith('|PR|Champion|'));
  if (titleIndex === -1) {
    return { champion: '' };
  }

  let [, pr, champion] = lines[titleIndex + 2].split('|');
  champion = champion ? champion.trim() : '';

  const pr_number = (pr.startsWith('#') ? pr.substring(1) : '').trim();
  return { champion, pr_number };
}