(input)
| 524 | } |
| 525 | |
| 526 | function cleanClaudeDump(input) { |
| 527 | return input |
| 528 | .replace(/[│┃╏╎|▌]+/g, '') |
| 529 | .replace(/ {2,}/g, ' ') |
| 530 | .replace(/([^\n])\n(?!\s*([\-*•●⏺▶▪◦]|\d+\.|[A-Z][a-z]|[📌🎯📋📖✨✅❌⭐🔥👉➡️]|$))/g, '$1 ') |
| 531 | .replace(/([a-z,:])\s*\n\s*([a-z])/g, '$1 $2') |
| 532 | .replace(/[ \t]+/g, ' ') |
| 533 | .split('\n') |
| 534 | .map(line => line.trim()) |
| 535 | .filter(line => line.length > 0) |
| 536 | .join('\n') |
| 537 | .replace(/\n{3,}/g, '\n\n') |
| 538 | .trim(); |
| 539 | } |
| 540 | |
| 541 | function detectAndClean(input) { |
| 542 | if (!input.trim()) { |