This commit is contained in:
root
2025-10-05 16:49:35 +05:00
parent c07c6e7dc4
commit 79e96a01f9
@@ -154,13 +154,13 @@ public class ResearchPdfService {
document.add(date); document.add(date);
} }
// ИСПРАВЛЕНО: Корректное регулярное выражение для очистки
private String cleanContent(String rawContent) { private String cleanContent(String rawContent) {
if (rawContent == null) { if (rawContent == null) {
return ""; return "";
} }
// Удаляем теги типа и другие похожие артефакты // Нормализуем переносы строк, избегая некорректных regex-замен
return rawContent.replaceAll("\\", "").trim(); String normalized = rawContent.replace("\r\n", "\n").replace("\r", "\n");
return normalized.trim();
} }
private void addMainReport(Document document, DeepResearchResponse researchResponse) throws DocumentException { private void addMainReport(Document document, DeepResearchResponse researchResponse) throws DocumentException {