(s)
| 4559 | |
| 4560 | // Escape text for attribute or text content. |
| 4561 | function escapeText(s) { |
| 4562 | if (!s) { |
| 4563 | return ""; |
| 4564 | } |
| 4565 | s = s + ""; |
| 4566 | |
| 4567 | // Both single quotes and double quotes (for attributes) |
| 4568 | return s.replace(/['"<>&]/g, function (s) { |
| 4569 | switch (s) { |
| 4570 | case "'": |
| 4571 | return "'"; |
| 4572 | case "\"": |
| 4573 | return """; |
| 4574 | case "<": |
| 4575 | return "<"; |
| 4576 | case ">": |
| 4577 | return ">"; |
| 4578 | case "&": |
| 4579 | return "&"; |
| 4580 | } |
| 4581 | }); |
| 4582 | } |
| 4583 | |
| 4584 | (function () { |
| 4585 |
no outgoing calls
no test coverage detected