minor rearrangement
This commit is contained in:
parent
ae378e8351
commit
134486743f
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@ import gleam/dict.{type Dict}
|
||||||
import gleam/list
|
import gleam/list
|
||||||
import gleam/string
|
import gleam/string
|
||||||
import gleam/pair
|
import gleam/pair
|
||||||
import gleam/regex.{type Match, Options}
|
import gleam/regex
|
||||||
|
|
||||||
pub type Mail {
|
pub type Mail {
|
||||||
Mail(headers: Dict(String, String), body: String)
|
Mail(headers: Dict(String, String), body: String)
|
||||||
|
@ -84,11 +84,11 @@ fn get_header_dict(s: String) -> #(String, String) {
|
||||||
|
|
||||||
fn fix_multiline_values(s: String) -> String {
|
fn fix_multiline_values(s: String) -> String {
|
||||||
let assert Ok(multi_line_value) =
|
let assert Ok(multi_line_value) =
|
||||||
regex.compile(": [^\n]+\n\\s+[^\n]+$", Options(True, True))
|
regex.compile(": [^\n]+\n\\s+[^\n]+$", regex.Options(True, True))
|
||||||
|
|
||||||
s
|
s
|
||||||
|> regex.scan(multi_line_value, _)
|
|> regex.scan(multi_line_value, _)
|
||||||
|> list.map(fn(match: Match) -> String { match.content })
|
|> list.map(fn(match) { match.content })
|
||||||
|> list.scan(s, remove_dead_space)
|
|> list.scan(s, remove_dead_space)
|
||||||
|> list.first
|
|> list.first
|
||||||
|> result.unwrap(or: "bar")
|
|> result.unwrap(or: "bar")
|
||||||
|
|
Loading…
Reference in a new issue