Files
Friendship-and-chat-im/im-uniapp/common/str.js
T
2025-11-25 11:50:02 +08:00

14 lines
207 B
JavaScript

let html2Escape = (strText) => {
return strText.replace(/[<>&"]/g, function(c) {
return {
'<': '&lt;',
'>': '&gt;',
'&': '&amp;',
'"': '&quot;'
} [c];
});
}
export default {
html2Escape
}