diff options
Diffstat (limited to 'browserenv.go')
-rw-r--r-- | browserenv.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/browserenv.go b/browserenv.go index 3f463a2..4ff70a4 100644 --- a/browserenv.go +++ b/browserenv.go @@ -77,6 +77,8 @@ func browserCommand(command, url string) *exec.Cmd { shell := shellArgs[0] args := shellArgs[1:] + url = escapeURL(url) + if browserCommandIncludesURL(command) { command = fmtWithURL(command, url) } else { @@ -96,3 +98,7 @@ func fmtWithURL(command, url string) string { // TODO: shellescape URL return strings.ReplaceAll(command, "%s", url) } + +func escapeURL(url string) string { + return strings.ReplaceAll(url, "'", "%27") +} |