Skip to content

Commit

Permalink
Fix URL Encoding for search buffer (#69)
Browse files Browse the repository at this point in the history
Fixes #69 

* Fix URL Encoding for search buffer
* Bump version number
  • Loading branch information
excalith authored Jan 19, 2024
1 parent 76015ab commit c0415f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "start-page",
"version": "3.1.1",
"version": "3.1.2",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
8 changes: 6 additions & 2 deletions src/utils/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ function openFilteredLinks(command, settings) {
export function DefaultSearch(buffer, settings) {
const defaultSerachEngine = settings.search.default
const target = settings.search.target
openLink(defaultSerachEngine + buffer, target)

const encodedBuffer = encodeURIComponent(buffer)
openLink(defaultSerachEngine + encodedBuffer, target)
}

function tryParseSearchShortcut(command, settings) {
Expand All @@ -67,7 +69,9 @@ function tryParseSearchShortcut(command, settings) {

if (name === regex_cmd[1]) {
const url = commandData.url
openLink(url.replace("{}", regex_cmd[2]), settings.urlLaunch.target)

const encodedBuffer = encodeURIComponent(regex_cmd[2])
openLink(url.replace("{}", encodedBuffer, settings.urlLaunch.target))
return true
}
}
Expand Down

1 comment on commit c0415f3

@vercel
Copy link

@vercel vercel bot commented on c0415f3 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

start-page – ./

excalith-start-page.vercel.app
start-page-excalith.vercel.app
start-page-git-main-excalith.vercel.app

Please sign in to comment.