diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-13 09:25:34 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-12-13 09:25:34 +0000 |
commit | a95103e6233d65f230327307904c67aadb871acb (patch) | |
tree | 28f596209ea7c105e1dd491aeef5e956c5d73b30 /web | |
parent | 8dbc6699e697ddbf06ea85e28804cf2c085826d0 (diff) | |
parent | c049907103c47e279706a319a0d8917ee6c968ab (diff) |
Merge branch '2346-unescape-titles'
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 98e538933..100eec15d 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -1354,7 +1354,19 @@ fixmystreet.display = { } var found = html.match(/<title>([\s\S]*?)<\/title>/); - var page_title = found[1]; + // Unencode HTML entities so it's suitable for document.title. We + // only care about the ones encoded by the template's html_filter. + var map = { + '&': '&', + '>': '>', + '<': '<', + '"': '"', + ''': "'" + }; + var page_title = found[1].replace(/&(amp|lt|gt|quot|#39);/g, function(m) { + return map[m]; + }); + fixmystreet.page = 'report'; $('.big-hide-pins-link').hide(); |