Fix #4016: Translated tags failing to find some tags.
* Normalize spaces to underscores when saving other names. Preserve case since case can be significant. * Fix WikiPage#other_names_include to search case-insensitively (note: this prevents using the index). * Fix sources to return the raw tags in `#tags` and the normalized tags in `#normalized_tags`. The normalized tags are the tags that will be matched against other names.
This commit is contained in:
@@ -20,8 +20,9 @@ module Sources
|
||||
end
|
||||
|
||||
should "get the tags" do
|
||||
tags = [["tag", "https://tumblr.com/tagged/tag"], ["red_hair", "https://tumblr.com/tagged/red_hair"]]
|
||||
assert_equal(tags, @site.tags)
|
||||
tags = ["tag", "red hair", "red-hair", "red_hair"]
|
||||
assert_equal(tags, @site.tags.map(&:first))
|
||||
assert_equal(["red_hair", "tag"], @site.normalized_tags)
|
||||
end
|
||||
|
||||
should "get the commentary" do
|
||||
@@ -100,8 +101,9 @@ module Sources
|
||||
end
|
||||
|
||||
should "get the tags" do
|
||||
tags = [["tag", "https://tumblr.com/tagged/tag"], ["red_hair", "https://tumblr.com/tagged/red_hair"]]
|
||||
assert_equal(tags, @site.tags)
|
||||
tags = ["tag", "red hair", "red-hair", "red_hair"]
|
||||
assert_equal(tags, @site.tags.map(&:first))
|
||||
assert_equal(["red_hair", "tag"], @site.normalized_tags)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user