datamade / django-councilmatic

:heartpulse: Django app providing core functions for *.councilmatic.org
http://councilmatic.org
MIT License
26 stars 16 forks source link

Generalize district table filter regex #64

Open patcon opened 8 years ago

patcon commented 8 years ago

Related to this line: https://github.com/datamade/django-councilmatic/blob/master/councilmatic_core/templates/partials/map.html#L140

Couple things that lead to unexpected behaviour:

This is very unexpected behaviour, and not inconcievable that someone else could hit it and spend quite a bit of time sorting it out. May I submit a PR to:

  1. Remove the "\b" metacharacters.
  2. Add a utility function to escape the regex.

cc: @jpmckinney, since you'll likely hit the same thing with other Canadian divisions

cc: @derekeder, since git-blame says you have the context :)