mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
loosen restrictions on chars in tags
This commit is contained in:
parent
aaf947356b
commit
2dfc0ddf81
@ -1,9 +1,7 @@
|
|||||||
require_dependency 'slug'
|
|
||||||
|
|
||||||
module DiscourseTagging
|
module DiscourseTagging
|
||||||
|
|
||||||
TAGS_FIELD_NAME = "tags"
|
TAGS_FIELD_NAME = "tags"
|
||||||
TAGS_FILTER_REGEXP = Slug::CHAR_FILTER_REGEXP
|
TAGS_FILTER_REGEXP = /[\/\?#\[\]@!\$&'\(\)\*\+,;=\.%\\`^\s|\{\}"<>]+/ # /?#[]@!$&'()*+,;=.%\`^|{}"<>
|
||||||
|
|
||||||
|
|
||||||
def self.tag_topic_by_names(topic, guardian, tag_names_arg)
|
def self.tag_topic_by_names(topic, guardian, tag_names_arg)
|
||||||
@ -143,7 +141,9 @@ module DiscourseTagging
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.clean_tag(tag)
|
def self.clean_tag(tag)
|
||||||
Slug.sanitize(tag.downcase.strip)[0...SiteSetting.max_tag_length]
|
tag.downcase.strip
|
||||||
|
.gsub(/\s+/, '-').squeeze('-')
|
||||||
|
.gsub(TAGS_FILTER_REGEXP, '')[0...SiteSetting.max_tag_length]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.staff_only_tags(tags)
|
def self.staff_only_tags(tags)
|
||||||
|
Loading…
Reference in New Issue
Block a user