aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2020-02-06 20:38:39 +0000
committerDave Arter <davea@mysociety.org>2020-02-07 15:15:02 +0000
commitdd9e5c6f9e1047369e263f101cb376d1381e49ba (patch)
tree48c63dfe4077d14bf1b59119d6a1bd3b72285a42
parente4c2224dc8a20d57bc3140f52c566574671708be (diff)
Allow class attribute to be set on a elements in form fields
This is handy for certain inputs that tie in to existing JS in the codebase, e.g. the TfL ‘category disabled’ messages that have a lat/lon appended by JS.
-rw-r--r--perllib/FixMyStreet/Template.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Template.pm b/perllib/FixMyStreet/Template.pm
index fb63071c3..fbd51dcb7 100644
--- a/perllib/FixMyStreet/Template.pm
+++ b/perllib/FixMyStreet/Template.pm
@@ -155,7 +155,7 @@ sub sanitize {
my $scrubber = HTML::Scrubber->new(
rules => [
%allowed_tags,
- a => { href => qr{^(http|/|tel)}i, style => 1, target => qr/^_blank$/, title => 1 },
+ a => { href => qr{^(http|/|tel)}i, style => 1, target => qr/^_blank$/, title => 1, class => qr/^js-/ },
img => { src => 1, alt => 1, width => 1, height => 1, hspace => 1, vspace => 1, align => 1, sizes => 1, srcset => 1 },
font => { color => 1 },
span => { style => 1 },