tags: don't allow tags to begin with a '/'.
Disallow tags from starting with a '/' character. This is so that tag
abbreviations in autocomplete, which start with a '/', don't conflict
with regular tags.
Also disallow some other punctuation characters: `%{})]. Currently no
tags start with these characters. This is to reserve other special
characters in case we need them for other future syntax extensions.
This commit is contained in:
@@ -97,16 +97,6 @@ class AutocompleteServiceTest < ActiveSupport::TestCase
|
||||
assert_autocomplete_includes("mole_under_eye", "-/mue", :tag_query)
|
||||
assert_autocomplete_includes("mole_under_eye", "~/mue", :tag_query)
|
||||
end
|
||||
|
||||
should "work for regular tags starting with a /" do
|
||||
create(:tag, name: "jojo_pose", post_count: 100)
|
||||
create(:tag, name: "/jp/", post_count: 50)
|
||||
|
||||
assert_autocomplete_equals(%w[/jp/ jojo_pose], "/", :tag_query)
|
||||
assert_autocomplete_equals(%w[/jp/ jojo_pose], "/j", :tag_query)
|
||||
assert_autocomplete_equals(%w[/jp/ jojo_pose], "/jp", :tag_query)
|
||||
assert_autocomplete_equals(%w[/jp/], "/jp/", :tag_query)
|
||||
end
|
||||
end
|
||||
|
||||
should "autocomplete tags from wiki and artist other names" do
|
||||
|
||||
Reference in New Issue
Block a user