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

Seal UserActions url does not substitute query #284

Open
ameddin73 opened this issue Oct 24, 2022 · 3 comments
Open

Seal UserActions url does not substitute query #284

ameddin73 opened this issue Oct 24, 2022 · 3 comments

Comments

@ameddin73
Copy link

When using Seal UserActions plugin with custom URL, the search term is never properly substituted. Instead, the query is always ${query}.

Here is my config, but I also tested by copying the Leo translate example from the docs and saw the same behavior.

["Google Search"] = {
	url = "https://www.google.com/search?q=${query}",
	icon = "favicon",
	keyword = "g",
},

Strangely, when I experiment with including symbols in the query sometimes it works.

For example:

  • The command g hello fails and openshttps://www.google.com/search?q=$%7Bquery%7D
  • The command g hello% successfully opens https://www.google.com/search?q=hello%25.
@ameddin73
Copy link
Author

I was able to get it working by making this change on line 279 of seal_useractions.lua:

local query_escaped = row.arg:gsub("%%", "%%%%")
local url = string.gsub(obj.actions[row.actionname].url, "${query}", query_escaped)

Very weird... I'm pretty stumped why this would fix it but it does. Maybe it's an issue with Lua?

Would you like me to open a PR?

@damc-dev
Copy link

damc-dev commented Nov 3, 2022

I was having the same issue, the fix @ameddin73's fix worked for me.

@thomasjachmann
Copy link
Contributor

There's a PR already: #272 No reaction yet, maybe we could boost this a little.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants