diff --git a/modules/formats/from-env.nu b/modules/formats/from-env.nu index 09ec1e5b9..c2b0cce45 100644 --- a/modules/formats/from-env.nu +++ b/modules/formats/from-env.nu @@ -7,10 +7,12 @@ def "from env" []: string -> record { | get column1 | parse "{key}={value}" | update value { - str trim -c '"' | # unquote values - str replace -a "\\n" "\n" # replace `\n` with newline char - str replace -a "\\r" "\r" # replace `\r` with carriage return - str replace -a "\\t" "\t" # replace `\t` with tab + str trim # Trim whitespace between value and inline comments + | str trim -c '"' # unquote double-quoted values + | str trim -c "'" # unquote single-quoted values + | str replace -a "\\n" "\n" # replace `\n` with newline char + | str replace -a "\\r" "\r" # replace `\r` with carriage return + | str replace -a "\\t" "\t" # replace `\t` with tab } | transpose -r -d }