[openstreetmap/openstreetmap-website] Added color preview box in tag browser sidebar (#1779)
notifications at github.com
Wed Mar 7 15:21:14 UTC 2018
Zverik commented on this pull request.
> @@ -188,4 +190,16 @@ def telephone_link(_key, value)
+ def colour_preview(key, value)
+ return nil unless (key =~ /^(|building:|ref:|roof:)colour$/ || key =~ /^(int_)?ref:colour(_(bg|tx))?$/) && !value.nil?
Thanks for trying different options. The long regular expression looks interesting, but it is not future-proof. I'd propose to use `/^(?:.+:)?colour$/` so that only `colour` or `whatever:colour` tags are matched.
I don't like variants with more suffixes, like `colour_tx` — that will catch wrong tags like `:colour_pattern` or apply only to local non-discussed tagging. Leading underscores are only used only in undocumented rare tags, so let's look only for semicolons.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rails-dev