Skip to content

Commit b51b8aa

Browse files
canadaduanemmstick
authored andcommitted
fix: allow web plugin to xdg-open custom URI schemes #154
1 parent 8641dc5 commit b51b8aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/src/web/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ impl App {
199199
fn build_query(definition: &Definition, query: &str) -> String {
200200
let q = definition.query.as_str();
201201

202-
let prefix = if q.starts_with("https://") || q.starts_with("http://") {
202+
let scheme_regex = Regex::new(r"^([a-zA-Z]+[a-zA-Z0-9\+\-\.]*):").unwrap();
203+
204+
let prefix = if scheme_regex.is_match(q) {
203205
""
204206
} else {
205207
"https://"

0 commit comments

Comments
 (0)