This PR fixes an issue where the fallback-url in the search-engine class does not correctly handle the case when it is empty. According to the documentation, if the fallback-url is empty, the search-url should be used on an empty search query. However, the current implementation results in a blank page being loaded instead. This PR addresses this issue by modifying the fallback-url method and the valid-url-p function to handle the empty fallback-url case correctly.
Summary of Changes
Modified the fallback-url method in source/search-engine.lisp to check if the fallback-url is an empty string. If it is, the search-url with an empty string is returned.
Modified the make-search-engine function in source/search-engine.lisp to set the fallback-url to nil if it is an empty string.
Modified the valid-url-p function in source/urls.lisp to return true if the URL is a search-url with an empty string.
This PR ensures that the search-url is correctly used when the fallback-url is empty, preventing a blank page from being loaded.
Fixes #5.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/fix-empty-fallback-url
🎉 Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR fixes an issue where the
fallback-url
in thesearch-engine
class does not correctly handle the case when it is empty. According to the documentation, if thefallback-url
is empty, thesearch-url
should be used on an empty search query. However, the current implementation results in a blank page being loaded instead. This PR addresses this issue by modifying thefallback-url
method and thevalid-url-p
function to handle the emptyfallback-url
case correctly.Summary of Changes
fallback-url
method insource/search-engine.lisp
to check if thefallback-url
is an empty string. If it is, thesearch-url
with an empty string is returned.make-search-engine
function insource/search-engine.lisp
to set thefallback-url
tonil
if it is an empty string.valid-url-p
function insource/urls.lisp
to return true if the URL is asearch-url
with an empty string.This PR ensures that the
search-url
is correctly used when thefallback-url
is empty, preventing a blank page from being loaded.Fixes #5.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: