Improve diff editing prompts to avoid common deepseek issues
This commit is contained in:
1 parent
f4b0887f60
commit
f770487695
4 files changed
+60
-33
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Fixes incorrectly escaped HTML entities in AI model outputs
|
||||
* @param text String potentially containing incorrectly escaped HTML entities from AI models
|
||||
* @returns String with HTML entities converted back to normal characters
|
||||
*/
|
||||
export function fixModelHtmlEscaping(text: string): string {
|
||||
return text
|
||||
.replace(/>/g, ">")
|
||||
.replace(/</g, "<")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/&/g, "&")
|
||||
.replace(/'/g, "'")
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes invalid characters (like the replacement character �) from a string
|
||||
* @param text String potentially containing invalid characters
|
||||
* @returns String with invalid characters removed
|
||||
*/
|
||||
export function removeInvalidChars(text: string): string {
|
||||
return text.replace(/\uFFFD/g, "")
|
||||
}
|
||||
Reference in new issue
Block a user