Remove html entity replace function when sanitizing text (#1049)
* add spacing between <> * remove check entirely * fix ol tag
This commit is contained in:
@@ -9,9 +9,6 @@ export const sanitizeChapterText = (
|
||||
html: string,
|
||||
options?: Options,
|
||||
): string => {
|
||||
if (html) {
|
||||
html = html.replace(/</g, '<').replace(/>/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'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user