fix: <br> is not escaped in output text

This commit is contained in:
Danny Liu 2024-04-22 00:16:05 -07:00
parent e6fad5ccb0
commit 8e94618c51

View file

@ -35,13 +35,12 @@ export const sanitizeResponseContent = (content: string) => {
.replace(/<\|[a-z]+\|$/, '')
.replace(/<$/, '')
.replaceAll(/<\|[a-z]+\|>/g, ' ')
.replaceAll(/<br\s?\/?>/gi, '\n')
.replaceAll('<', '&lt;')
.trim();
};
export const revertSanitizedResponseContent = (content: string) => {
return content.replaceAll('&lt;', '<');
return content.replaceAll('&lt;', '<');
};
export const capitalizeFirstLetter = (string) => {