Browse Source

polish off api

merge-requests/1/head
Egor Kislitsyn 5 years ago
parent
commit
2266370ebf
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      lib/auto_linker.ex
  2. +1
    -0
      lib/auto_linker/parser.ex

+ 1
- 1
lib/auto_linker.ex 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


+ 1
- 0
lib/auto_linker/parser.ex 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


Loading…
Cancel
Save