export function esc(value: string): string {
  return value
    .replace(/&/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;')
    .replace(/'/g, '&#39;');
}

export function sectionFrame(inner: string, cover = false): string {
  return `<div class="section${cover ? ' section-cover' : ''}">${cover ? '<div class="frame"></div>' : ''}${inner}</div>`;
}

export function sectionHeader(title: string): string {
  return `<div class="header"><span class="logo">G</span><span class="brand">恭学教育 · 学生档案</span><span class="page-kicker">${esc(title)}</span></div>`;
}

export function coverFooter(): string {
  return `<div class="footer"><span>恭学教育 · 学生档案报告</span><span>机密 · 仅限内部使用</span></div>`;
}
