From b231e47108f60beb3ad781b2e1e70e233bc36ab9 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 9 Jul 2023 02:29:04 +0200 Subject: [PATCH] allow _ for spaces (easier to use in browsers/shells where spaces lead to unwanted behaviour, e.g. starting a search or ending an argument) --- src/bahnhofname.gleam | 2 ++ 1 file changed, 2 insertions(+) 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 }