mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: markdown rendering
Co-Authored-By: Jun Siang Cheah <me@jscheah.me>
This commit is contained in:
@@ -90,6 +90,11 @@ export const revertSanitizedResponseContent = (content: string) => {
|
||||
return content.replaceAll('<', '<').replaceAll('>', '>');
|
||||
};
|
||||
|
||||
export function unescapeHtml(html: string) {
|
||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||
return doc.documentElement.textContent;
|
||||
}
|
||||
|
||||
export const capitalizeFirstLetter = (string) => {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user