(url, basePath, hashPrefix)
| 5090 | |
| 5091 | |
| 5092 | function convertToHtml5Url(url, basePath, hashPrefix) { |
| 5093 | var match = matchUrl(url); |
| 5094 | |
| 5095 | // already html5 url |
| 5096 | if (decodeURIComponent(match.path) != basePath || isUndefined(match.hash) || |
| 5097 | match.hash.indexOf(hashPrefix) !== 0) { |
| 5098 | return url; |
| 5099 | // convert hashbang url -> html5 url |
| 5100 | } else { |
| 5101 | return composeProtocolHostPort(match.protocol, match.host, match.port) + |
| 5102 | pathPrefixFromBase(basePath) + match.hash.substr(hashPrefix.length); |
| 5103 | } |
| 5104 | } |
| 5105 | |
| 5106 | |
| 5107 | function convertToHashbangUrl(url, basePath, hashPrefix) { |
no test coverage detected