aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-13 09:25:34 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-13 09:25:34 +0000
commita95103e6233d65f230327307904c67aadb871acb (patch)
tree28f596209ea7c105e1dd491aeef5e956c5d73b30 /web
parent8dbc6699e697ddbf06ea85e28804cf2c085826d0 (diff)
parentc049907103c47e279706a319a0d8917ee6c968ab (diff)
Merge branch '2346-unescape-titles'
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js14
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 = {
+ '&amp;': '&',
+ '&gt;': '>',
+ '&lt;': '<',
+ '&quot;': '"',
+ '&#39;': "'"
+ };
+ 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();