(input)
| 489 | } |
| 490 | |
| 491 | function cleanLLMText(input) { |
| 492 | return input |
| 493 | .replace( |
| 494 | /([^\n])\n(?!\s*([\-*•●⏺▶▪◦]|\d+\.|[A-Z][a-z]|[📌🎯📋📖✨✅❌⭐🔥👉➡️]|$))/g, |
| 495 | '$1 ' |
| 496 | ) |
| 497 | .replace(/[ \t]+/g, ' ') |
| 498 | .split('\n') |
| 499 | .map(line => line.trim()) |
| 500 | .join('\n') |
| 501 | .replace(/\n{3,}/g, '\n\n') |
| 502 | .trim(); |
| 503 | } |
| 504 | |
| 505 | function cleanGitDiff(input) { |
| 506 | return input |