@@ -67,7 +67,7 @@ function sanitizeImgTag(tagName, attributes) {
|
||||
return { tagName, attribs };
|
||||
}
|
||||
|
||||
export default function sanitize(body) {
|
||||
export function sanitizeCustomHtml(body) {
|
||||
return sanitizeHtml(body, {
|
||||
allowedTags: [
|
||||
'font',
|
||||
@@ -142,3 +142,12 @@ export default function sanitize(body) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function sanitizeText(body) {
|
||||
const tagsToReplace = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
};
|
||||
return body.replace(/[&<>]/g, (tag) => tagsToReplace[tag] || tag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user