mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
fix: <br> is not escaped in output text
This commit is contained in:
parent
e6fad5ccb0
commit
8e94618c51
@ -35,13 +35,12 @@ export const sanitizeResponseContent = (content: string) => {
|
|||||||
.replace(/<\|[a-z]+\|$/, '')
|
.replace(/<\|[a-z]+\|$/, '')
|
||||||
.replace(/<$/, '')
|
.replace(/<$/, '')
|
||||||
.replaceAll(/<\|[a-z]+\|>/g, ' ')
|
.replaceAll(/<\|[a-z]+\|>/g, ' ')
|
||||||
.replaceAll(/<br\s?\/?>/gi, '\n')
|
|
||||||
.replaceAll('<', '<')
|
.replaceAll('<', '<')
|
||||||
.trim();
|
.trim();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const revertSanitizedResponseContent = (content: string) => {
|
export const revertSanitizedResponseContent = (content: string) => {
|
||||||
return content.replaceAll('<', '<');
|
return content.replaceAll('<', '<');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const capitalizeFirstLetter = (string) => {
|
export const capitalizeFirstLetter = (string) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user