Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%23 hack fixes #149

Merged
merged 2 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading