Skip to content

Commit

Permalink
Merge pull request #149 from utopiatopia/main
Browse files Browse the repository at this point in the history
%23 hack fixes
  • Loading branch information
nobodywasishere authored Jan 11, 2025
2 parents 36e87b3 + 18667e8 commit 2753adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions data/bangs.json
Original file line number Diff line number Diff line change
Expand Up @@ -67386,10 +67386,9 @@
"s": "Openstreetmap forum Netherlands",
"d": "community.openstreetmap.org",
"t": "osmforumnl",
"u": "https://community.openstreetmap.org/search?q={{{s}}}%20%23communities%3Anl",
"u": "https://community.openstreetmap.org/search?q={{{s}}}%20%23communities:nl",
"c": "Online Services",
"sc": "Maps",
"skip_tests": true
"sc": "Maps"
},
{
"s": "OpenStreetMap Community Forum",
Expand Down
6 changes: 3 additions & 3 deletions spec/bangs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ def uri_decoded_urls(bangs)
next if bang["skip_tests"]

it "template should not be uri encoded (#{bang["s"]})" do
expect(CGI.unescapeURIComponent(bang["u"]).to_s).to eq(bang["u"])
expect(CGI.unescapeURIComponent(bang["u"].gsub(/%20|%23/,"")).to_s).to eq(bang["u"].gsub(/%20|%23/,""))
end

it "domain should not be uri encoded (#{bang["s"]})" do
expect(CGI.unescapeURIComponent(bang["d"]).to_s).to eq(bang["d"])
expect(CGI.unescapeURIComponent(bang["d"].gsub(/%20|%23/,"")).to_s).to eq(bang["d"].gsub(/%20|%23/,""))
end

if bang["ad"]
it "alt domain should not be uri encoded (#{bang["s"]})" do
expect(CGI.unescapeURIComponent(bang["ad"]).to_s).to eq(bang["ad"])
expect(CGI.unescapeURIComponent(bang["ad"].gsub(/%20|%23/,"")).to_s).to eq(bang["ad"].gsub(/%20|%23/,""))
end
end
end
Expand Down

0 comments on commit 2753adf

Please sign in to comment.