(str)
| 48 | |
| 49 | //https://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-of-a-string-in-javascript |
| 50 | function escapeRegExp(str) { |
| 51 | return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string |
| 52 | } |
| 53 | |
| 54 | function rewriteURLs(html) { |
| 55 | for (var key in map) { |