Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

remove Html Tags

Khuram Niaze6d36cfe5dd5
diff --git a/src/utils/ai.utils.ts b/src/utils/ai.utils.ts
index ff4d2c4..c102350 100644
--- a/src/utils/ai.utils.ts
+++ b/src/utils/ai.utils.ts
@@ -11,7 +11,20 @@ import { AiProvider } from "@/models/ai.model";
const removeHtmlTags = (description: string | undefined): string => {
if (!description) return "N/A";
- return description.replace(/<[^>]+>/g, "");
+
+ return (
+ description
+ // Convert list items to bullet points before stripping tags
+ .replace(/<li[^>]*>/gi, "• ")
+ // Add line breaks after block elements
+ .replace(/<\/(li|p|div|br)[^>]*>/gi, "\n")
+ .replace(/<br\s*\/?>/gi, "\n")
+ // Remove all remaining HTML tags
+ .replace(/<[^>]+>/g, "")
+ // Clean up excessive whitespace while preserving structure
+ .replace(/\n\s*\n/g, "\n")
+ .trim()
+ );
};
export interface ModelCheckResult {