Fix #5136: Regular tags are now case-sensitive.

* Fix `AST.tag` to downcase the tag name.
* Change PostQuery::Parser to use build nodes using `AST.tag`,
  `AST.metatag`, `AST.wildcard`, etc methods instead of building nodes
  directly. This way all the normalization happens in the node
  constructor methods instead of in the parser.
This commit is contained in:
evazion
2022-04-22 02:07:36 -05:00
parent 90182148aa
commit db6bb2ccac
3 changed files with 40 additions and 28 deletions

View File

@@ -85,6 +85,7 @@ class PostQueryBuilderTest < ActiveSupport::TestCase
post3 = create(:post, tag_string: "bbb ccc")
assert_tag_match([post2, post1], "aaa")
assert_tag_match([post2, post1], "AAA")
assert_tag_match([post2, post1], " aaa ")
end