Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

449 B
Raw Blame
function escapeHtml(text: string): string {
  return text
    .replace(/&/g, '&')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;');
}

export function plainTextToHtml(text: string): string {
  const lines = text.split('\n');
  const inner = lines
    .map((line) => {
      if (!line) return '<br>';
      return `<span style="white-space: pre-wrap;">${escapeHtml(line)}</span>`;
    })
    .join('<br>');
  return `<div>${inner}</div>`;
}