Parcourir la source

Make underscorifying keys optional

pull/7/head
Greg V il y a 2 ans
Parent
révision
d9ead5c456
  1. 4
      lib/helpers.ex

4
lib/helpers.ex

@ -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()

Chargement…
Annuler
Enregistrer