10 changed files with 76 additions and 59 deletions
@ -0,0 +1,14 @@ |
|||||
|
let html2Escape = (strText) => { |
||||
|
return strText.replace(/[<>&"]/g, function(c) { |
||||
|
return { |
||||
|
'<': '<', |
||||
|
'>': '>', |
||||
|
'&': '&', |
||||
|
'"': '"' |
||||
|
} [c]; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
html2Escape |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
let html2Escape = (strText) => { |
||||
|
return strText.replace(/[<>&"]/g, function(c) { |
||||
|
return { |
||||
|
'<': '<', |
||||
|
'>': '>', |
||||
|
'&': '&', |
||||
|
'"': '"' |
||||
|
} [c]; |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
html2Escape |
||||
|
} |
||||
Loading…
Reference in new issue