polish off api

This commit is contained in:
Egor Kislitsyn 2019-02-08 16:43:06 +07:00
parent 0110f8e9f0
commit 2266370ebf
2 changed files with 2 additions and 1 deletions

View file

@ -59,7 +59,7 @@ defmodule AutoLinker do
Note that passing opts to `link/2` will override the configuration settings.
"""
def link(text, opts \\ []) do
parse({text, nil}, opts) |> elem(0)
parse(text, opts)
end
def link_map(text, acc, opts \\ []) do

View file

@ -66,6 +66,7 @@ defmodule AutoLinker.Parser do
@default_opts ~w(url)a
def parse(input, opts \\ %{})
def parse(input, opts) when is_binary(input), do: parse({input, nil}, opts) |> elem(0)
def parse(input, list) when is_list(list), do: parse(input, Enum.into(list, %{}))
def parse(input, opts) do