fix: Outreach speedup (Switch to Flash) & Robust MD Export
This commit is contained in:
@@ -43,35 +43,34 @@ export const StepReport: React.FC<StepReportProps> = ({ results, strategy, onRes
|
||||
};
|
||||
|
||||
const downloadMarkdown = () => {
|
||||
const signalHeaders = strategy.signals.map(s => s.name);
|
||||
if (!strategy || !results) return;
|
||||
|
||||
const signalHeaders = (strategy.signals || []).map(s => s.name);
|
||||
const headers = ["Company", "Prio", "Rev/Emp", "Status", ...signalHeaders, "Recommendation"];
|
||||
|
||||
const rows = sortedResults.map(r => {
|
||||
const signalValues = strategy.signals.map(s => {
|
||||
const data = r.dynamicAnalysis[s.id];
|
||||
const signalValues = (strategy.signals || []).map(s => {
|
||||
const data = r.dynamicAnalysis ? r.dynamicAnalysis[s.id] : null;
|
||||
if (!data) return '-';
|
||||
|
||||
let content = data.value || '-';
|
||||
// Sanitize content pipes
|
||||
content = content.replace(/\|/g, '\\|');
|
||||
|
||||
if (data.proof) {
|
||||
// Sanitize proof pipes and newlines
|
||||
const safeProof = data.proof.replace(/\|/g, '\\|').replace(/(\r\n|\n|\r)/gm, ' ');
|
||||
content += `<br><sub>*Proof: ${safeProof}*</sub>`;
|
||||
}
|
||||
return content;
|
||||
});
|
||||
|
||||
// Helper to sanitize other fields
|
||||
const safe = (str: string) => (str || '').replace(/\|/g, '\\|').replace(/(\r\n|\n|\r)/gm, ' ');
|
||||
|
||||
return `| ${safe(r.companyName)} | ${r.tier} | ${safe(r.revenue)} / ${safe(r.employees)} | ${r.status} | ${signalValues.join(" | ")} | ${safe(r.recommendation)} |`;
|
||||
});
|
||||
|
||||
const content = `
|
||||
# Market Intelligence Report: ${strategy.productContext}
|
||||
**Context:** ${strategy.idealCustomerProfile}
|
||||
# Market Intelligence Report: ${strategy.productContext || 'N/A'}
|
||||
**Context:** ${strategy.idealCustomerProfile || 'N/A'}
|
||||
|
||||
**Search Strategy ICP:** ${strategy.searchStrategyICP || 'N/A'}
|
||||
**Digital Signals:** ${strategy.digitalSignals || 'N/A'}
|
||||
|
||||
Reference in New Issue
Block a user