Remove html entity replace function when sanitizing text (#1049)

* add spacing between <>

* remove check entirely

* fix ol tag
This commit is contained in:
K1ngfish3r
2024-05-28 13:51:36 +08:00
committed by GitHub
parent 671e4f4bfd
commit 6864d07dd9
@@ -9,9 +9,6 @@ export const sanitizeChapterText = (
html: string,
options?: Options,
): string => {
if (html) {
html = html.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
}
let text = sanitizeHtml(html, {
allowedTags: sanitizeHtml.defaults.allowedTags.concat([
'img',
@@ -20,10 +17,13 @@ export const sanitizeChapterText = (
'b',
'a',
'div',
'ol',
'li',
]),
allowedAttributes: {
'img': ['src'],
'a': ['href'],
'ol': ['reversed', 'start', 'type'],
},
allowedSchemes: ['data', 'http', 'https', 'file'],
});