Fix non-english characters delete on tags (#2579)
This commit is contained in:
parent
2ea6accec1
commit
5b0340351b
2 changed files with 5 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ module ActsAsTaggableOn
|
|||
return [] if string.blank?
|
||||
|
||||
string.downcase.split(",").map do |t|
|
||||
t.strip.delete(" ").gsub(/[^0-9a-z]/i, "")
|
||||
t.strip.delete(" ").gsub(/[^[:alnum:]]/i, "")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ RSpec.describe ActsAsTaggableOn::TagParser do
|
|||
tags = ["w0rd", "app|3", "&!tes4@#$%^&*"]
|
||||
expect(create_tag_parser(tags)).to eq(%w[w0rd app3 tes4])
|
||||
end
|
||||
it "allows non-english characters" do
|
||||
tags = %w[Optimización Καλημέρα Français]
|
||||
expect(create_tag_parser(tags)).to eq(%w[optimización καλημέρα français])
|
||||
end
|
||||
it "returns nothing if nothing is recieved" do
|
||||
expect(create_tag_parser([])).to eq([])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue