tag.rb: don't strip '%' or ',' from tags; split on unicode spaces.
Allows '%' and ',' in tag names. There's no technical need to forbid these characters. Fixes an issue with these characters being stripped away inside metatags (e.g. tagging a post with `pool:ichigo_100%` strips away the '%').
This commit is contained in:
@@ -229,13 +229,13 @@ class Tag < ActiveRecord::Base
|
||||
def scan_query(query)
|
||||
tagstr = normalize(query)
|
||||
list = tagstr.scan(/-?source:".*?"/) || []
|
||||
list + tagstr.gsub(/-?source:".*?"/, "").scan(/\S+/).uniq
|
||||
list + tagstr.gsub(/-?source:".*?"/, "").scan(/[^[:space:]]+/).uniq
|
||||
end
|
||||
|
||||
def scan_tags(tags, options = {})
|
||||
tagstr = normalize(tags)
|
||||
list = tagstr.scan(/source:".*?"/) || []
|
||||
list += tagstr.gsub(/source:".*?"/, "").gsub(/[%,]/, "").scan(/\S+/).uniq
|
||||
list += tagstr.gsub(/source:".*?"/, "").scan(/[^[:space:]]+/).uniq
|
||||
if options[:strip_metatags]
|
||||
list = list.map {|x| x.sub(/^[-~]/, "")}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user