Browse Source

Make underscorifying keys optional

pull/7/head
Greg V 1 year ago
parent
commit
d9ead5c456
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      lib/helpers.ex

+ 3
- 1
lib/helpers.ex View File

@@ -81,7 +81,9 @@ defmodule Microformats2.Helpers do

@spec to_key(String.t()) :: String.t()
def to_key(str) do
String.replace(str, ~r/[-]/, "_")
if Application.get_env(:microformats2, :underscore_keys, true),
do: String.replace(str, ~r/[-]/, "_"),
else: str
end

@spec normalized_key(String.t()) :: String.t() | atom()


Loading…
Cancel
Save