9 lines
205 B
JavaScript
9 lines
205 B
JavaScript
|
export const escapeHtml = (unsafe = '') => {
|
||
|
return unsafe
|
||
|
.replace(/&/g, '&')
|
||
|
.replace(/</g, '<')
|
||
|
.replace(/>/g, '>')
|
||
|
.replace(/"/g, '"')
|
||
|
.replace(/'/g, ''');
|
||
|
};
|