codeforsanjose / MobilityMap

Allows citizens to engage public transit authority on a map in real-time
GNU General Public License v3.0
2 stars 1 forks source link

Http addresses inside hints should become links #61

Open 3vivekb opened 8 years ago

3vivekb commented 8 years ago

Http address are a little burdensome inside hints. It is an acceptable way of describing an issue - but it should be a link instead.

zpallin commented 8 years ago

I have an idea to do this right.

The fear is if we allow links to show up they could be malicious links supplied by bots that troll the site.

What I will do is parse comments to allow for links if they use a domain that is approved by one of the authorities. Essentially, people who are green-lighted as authority members of the transportation community (vta included) would have a list that they can manage of their domains that link to their sites.

Additionally, I will probably create a "central" authority and green light domains by hand on my own if I deem it necessary.

wilsonww commented 8 years ago

All right. Made progress on this one. Registered a helper on Handlebars and found some link parsing regex functions to use.

See in action http://mobilitymap.org/place/1125

See pull request https://github.com/codeforsanjose/MobilityMap/pull/71

This is currently on the production server @zpallin sorry for breaking code of conduct. Left production on my issue-61 branch. If you or Vivek test and confirm the auto-linking is working, I can accept the pull request and switch back to master and pull in from github.

Haven't implemented the check for invalid domains. Next phase!