summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2023-07-09 02:29:04 +0200
committerstuebinm2023-07-09 02:29:04 +0200
commitb231e47108f60beb3ad781b2e1e70e233bc36ab9 (patch)
tree80a50308fc4dc8ffe2665624093b27970fa458a8
parent6a61154bdad9315cc8fede127f74e8dd240dd4db (diff)
allow _ for spaces
(easier to use in browsers/shells where spaces lead to unwanted behaviour, e.g. starting a search or ending an argument)
-rw-r--r--src/bahnhofname.gleam2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bahnhofname.gleam b/src/bahnhofname.gleam
index 27167a9..725d0ae 100644
--- a/src/bahnhofname.gleam
+++ b/src/bahnhofname.gleam
@@ -14,6 +14,7 @@ import gleam/map.{Map}
import gleam/uri
import gleam/hackney
import gleam/pair.{swap}
+import gleam/result
import mist
const ds100_domain = "ds100.bahnhof.name"
@@ -99,6 +100,7 @@ fn unpercent(encoded: String) -> String {
|> list.prepend(bit_string.from_string(head))
|> bit_string.concat
|> bit_string.to_string
+ |> result.map(fn (str) { string.replace(str, "_", " ") })
res
}