Set tags max length to 160
This commit is contained in:
@@ -8,7 +8,7 @@ App.Tags =
|
||||
|
||||
unless $this.data('initialized') is 'yes'
|
||||
$this.on('click', ->
|
||||
name = $(this).text()
|
||||
name = '"' + $(this).text() + '"'
|
||||
current_tags = $tag_input.val().split(',').filter(Boolean)
|
||||
|
||||
if $.inArray(name, current_tags) >= 0
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class TagSanitizer
|
||||
DISALLOWED_STRINGS = %w(? < > = /)
|
||||
DISALLOWED_STRINGS = %w[? < > = /]
|
||||
|
||||
def sanitize_tag(tag)
|
||||
tag = tag.dup
|
||||
DISALLOWED_STRINGS.each do |s|
|
||||
tag.gsub!(s, '')
|
||||
tag.gsub!(s, "")
|
||||
end
|
||||
tag.truncate(TagSanitizer.tag_max_length)
|
||||
end
|
||||
@@ -14,7 +14,7 @@ class TagSanitizer
|
||||
end
|
||||
|
||||
def self.tag_max_length
|
||||
40
|
||||
160
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user