* Helpers
(html, encode)
| 1074 | */ |
| 1075 | |
| 1076 | function escape(html, encode) { |
| 1077 | return html |
| 1078 | .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') |
| 1079 | .replace(/</g, '<') |
| 1080 | .replace(/>/g, '>') |
| 1081 | .replace(/"/g, '"') |
| 1082 | .replace(/'/g, '''); |
| 1083 | } |
| 1084 | |
| 1085 | function unescape(html) { |
| 1086 | return html.replace(/&([#\w]+);/g, function(_, n) { |
no outgoing calls
no test coverage detected